renoise.Views.Button
A simple button that calls a custom notifier function when clicked. Supports text or bitmap labels.
+--------+ | Button | +--------+
- Properties
- text :
ButtonLabel
- bitmap :
ButtonBitmapPath
- align :
ButtonAlignment
- font :
TextFontStyle
- color :
ButtonColor
- secondary_color :
ButtonSecondaryColor
- style :
ButtonStyle
- active :
ControlActive
- midi_mapping :
ControlMidiMappingString
- visible :
ViewVisibility
- origin :
ViewOrigin
- width :
ViewDimension
- height :
ViewDimension
- size :
ViewSize
- tooltip :
ViewTooltip
- cursor :
ViewCursorShape
- views :
renoise.Views.View
[]
- text :
- Functions
- add_pressed_notifier(self, notifier :
NotifierFunction
) - add_released_notifier(self, notifier :
NotifierFunction
) - remove_pressed_notifier(self, notifier :
NotifierFunction
) - remove_released_notifier(self, notifier :
NotifierFunction
) - add_view(self, child :
renoise.Views.View
) - remove_view(self, child :
renoise.Views.View
) - swap_views(self, child1 :
renoise.Views.View
, child2 :renoise.Views.View
) - add_child(self, child :
renoise.Views.View
) - remove_child(self, child :
renoise.Views.View
) - swap_childs(self, child1 :
renoise.Views.View
, child2 :renoise.Views.View
)
- add_pressed_notifier(self, notifier :
- Aliases
Properties
text : ButtonLabel
The text label of the button
- Default: ""
bitmap : ButtonBitmapPath
If set, existing text is removed and the loaded image is displayed instead. Supported bitmap file formats are ".bmp", ".png" and ".tiff". Colors in bitmaps will be overridden by the button's theme color, using black as the transparent color for BMPs and TIFFS, and the alpha channel for PNGs. All other colors are mapped to the theme color according to their grey value, so plain white is the target theme color, and all other colors blend into the button's background color of the theme.
align : ButtonAlignment
Setup the buttons text's or bitmap's alignment within the button.
font : TextFontStyle
The style that the text should be displayed with.
color : ButtonColor
When set, the unpressed button's background will be drawn in the specified color. A text color is automatically selected unless explicitly set, to make sure its always visible. Set color {0,0,0} to enable the theme colors for the button again.
secondary_color : ButtonSecondaryColor
When set, the unpressed button's background text or bitmap will be drawn in the specified color. Set color {0,0,0} to enable the theme colors for the button again.
style : ButtonStyle
Get/set the style a button should be displayed with.
active : ControlActive
Instead of making a control invisible, you can also make it inactive. Deactivated controls will still be shown, and will still show their currently assigned values, but will not allow changes. Most controls will display as "grayed out" to visualize the deactivated state.
midi_mapping : ControlMidiMappingString
When set, the control will be highlighted when Renoise's MIDI mapping dialog is open. When clicked, it selects the specified string as a MIDI mapping target action. This target acton can either be one of the globally available mappings in Renoise, or those that were created by the tool itself. Target strings are not verified. When they point to nothing, the mapped MIDI message will do nothing and no error is fired.
visible : ViewVisibility
Set visible to false to hide a view (make it invisible without removing it). Please note that view.visible will also return false when any of its parents are invisible (when its implicitly invisible).
- Default: true
origin : ViewOrigin
The position of a view within its parent view. Only the
stack
layouts allows to freely position child views. Other layout views will automatically set the origin, but the origin then still can be read in for example mouse handlers.
width : ViewDimension
Deprecated. Use property
size
instead.
height : ViewDimension
Deprecated. Use property
size
instead.
size : ViewSize
The dimensions of a view has to be larger than 0. For nested views you can also specify relative size, for example
vb:text { size = { width = "80%", height = 20}}
. The percentage values are relative to the view's parent size and will automatically update when the parent view's size changes.
tooltip : ViewTooltip
A ViewTooltip text that should be shown for this view on mouse hover.
- Default: "" (no tip will be shown)
cursor : ViewCursorShape
The cursor cursor for this view which apears on mouse hover. Using a "none" shape will use use underlying view's cursor or the default cursor.
views : renoise.Views.View
[]
READ-ONLY Empty for all controls, for layout views this contains the layout child views in the order they got added
Functions
add_pressed_notifier(self, notifier : NotifierFunction
)
Add/remove button hit/release notifier functions. When a "pressed" notifier is set, the release notifier is guaranteed to be called as soon as the mouse is released, either over your button or anywhere else. When a "release" notifier is set, it is only called when the mouse button is pressed !and! released over your button.
add_released_notifier(self, notifier : NotifierFunction
)
remove_pressed_notifier(self, notifier : NotifierFunction
)
remove_released_notifier(self, notifier : NotifierFunction
)
add_view(self, child : renoise.Views.View
)
Add a new child view to this view.
remove_view(self, child : renoise.Views.View
)
Remove a child view from this view.
swap_views(self, child1 : renoise.Views.View
, child2 : renoise.Views.View
)
Swap position of two child views in this view. With a series of swaps views can be moved to any position in the parent.
add_child(self, child : renoise.Views.View
)
Deprecated. Use
add_view
instead
remove_child(self, child : renoise.Views.View
)
Deprecated. Use
remove_view
instead
swap_childs(self, child1 : renoise.Views.View
, child2 : renoise.Views.View
)
Deprecated. Use
swap_views
instead
Aliases
BitmapImagePath
You can load an image from your tool's directory, or use one from Renoise's built-in icons.
- For the built-in icons, use "Icons/ArrowRight.bmp"
- For custom images, use a path relative to your tool's root folder.
For example "Images/MyBitmap.bmp" will load the image from "com.me.MyTool.xrnx/Images/MyBitmap.bmp".
If your custom path matches a built-in icon's (like "Icons/ArrowRight.bmp"), your image will be loaded instead of the one from Renoise.If you want to support high DPI UI scaling with your bitmaps like the built-in Icons, include high resolution versions with their filenames ending with "@4x"
The following rules will be used when loading bitmaps
- When UI scaling is 100%, only the base bitmaps are used.
- When UI scaling is 125%, the base bitmaps are used, except if there is a
BitmapName@x1.25.bmp
variant.- For all other UI scaling > 125% the "@4x" variants are used and downscaled as needed, except when there is an exact match for the current UI scaling factor (e.g.
BitmapName@1.5x.bmp
for 150%)
ButtonAlignment
"center"
| "left"
| "right"
-- Setup the buttons text's or bitmap's alignment within the button. ButtonAlignment: | "left" -- aligned to the left | "right" -- aligned to the right | "center" -- center (default)
ButtonBitmapPath
If set, existing text is removed and the loaded image is displayed instead. Supported bitmap file formats are ".bmp", ".png" and ".tiff". Colors in bitmaps will be overridden by the button's theme color, using black as the transparent color for BMPs and TIFFS, and the alpha channel for PNGs. All other colors are mapped to the theme color according to their grey value, so plain white is the target theme color, and all other colors blend into the button's background color of the theme.
ButtonColor
-- When set, the unpressed button's background will be drawn in the specified color. -- A text color is automatically selected unless explicitly set, to make sure its -- always visible. -- Set color {0,0,0} to enable the theme colors for the button again. -- A table of 3 bytes (ranging from 0 to 255) -- representing the red, green and blue channels of a color. -- {0xFF, 0xFF, 0xFF} is white -- {165, 73, 35} is the red from the Renoise logo -- The application theme's colors ButtonColor: | "main_back" | "main_font" | "alternate_main_back" | "alternate_main_font" | "body_back" | "body_font" | "strong_body_font" | "button_back" | "button_font" | "button_highlight_font" | "selected_button_back" | "selected_button_font" | "selection_back" | "selection_font" | "standby_selection_back" | "standby_selection_font" | "midi_mapping_back" | "midi_mapping_font" | "tooltip_back" | "tooltip_font" | "valuebox_back" | "valuebox_font" | "valuebox_font_icons" | "scrollbar" | "slider" | "folder" | "pattern_default_back" | "pattern_default_font" | "pattern_default_font_volume" | "pattern_default_font_panning" | "pattern_default_font_pitch" | "pattern_default_font_delay" | "pattern_default_font_global" | "pattern_default_font_other" | "pattern_default_font_dspfx" | "pattern_default_font_unused" | "pattern_highlighted_back" | "pattern_highlighted_font" | "pattern_highlighted_font_volume" | "pattern_highlighted_font_panning" | "pattern_highlighted_font_pitch" | "pattern_highlighted_font_delay" | "pattern_highlighted_font_global" | "pattern_highlighted_font_other" | "pattern_highlighted_font_dspfx" | "pattern_highlighted_font_unused" | "pattern_playposition_back" | "pattern_playposition_font" | "pattern_centerbar_back" | "pattern_centerbar_font" | "pattern_centerbar_back_standby" | "pattern_centerbar_font_standby" | "pattern_selection" | "pattern_standby_selection" | "pattern_mute_state" | "automation_grid" | "automation_line_edge" | "automation_line_fill" | "automation_point" | "automation_marker_play" | "automation_marker_single" | "automation_marker_pair" | "automation_marker_diamond" | "vumeter_meter" | "vumeter_meter_low" | "vumeter_meter_middle" | "vumeter_meter_high" | "vumeter_peak" | "vumeter_back_normal" | "vumeter_back_clipped" | "default_color_01" | "default_color_02" | "default_color_03" | "default_color_04" | "default_color_05" | "default_color_06" | "default_color_07" | "default_color_08" | "default_color_09" | "default_color_10" | "default_color_11" | "default_color_12" | "default_color_13" | "default_color_14" | "default_color_15" | "default_color_16"
ButtonLabel
The text label of the button
- Default: ""
ButtonSecondaryColor
-- When set, the unpressed button's background text or bitmap will be drawn in the -- specified color. -- Set color {0,0,0} to enable the theme colors for the button again. -- A table of 3 bytes (ranging from 0 to 255) -- representing the red, green and blue channels of a color. -- {0xFF, 0xFF, 0xFF} is white -- {165, 73, 35} is the red from the Renoise logo -- The application theme's colors ButtonSecondaryColor: | "main_back" | "main_font" | "alternate_main_back" | "alternate_main_font" | "body_back" | "body_font" | "strong_body_font" | "button_back" | "button_font" | "button_highlight_font" | "selected_button_back" | "selected_button_font" | "selection_back" | "selection_font" | "standby_selection_back" | "standby_selection_font" | "midi_mapping_back" | "midi_mapping_font" | "tooltip_back" | "tooltip_font" | "valuebox_back" | "valuebox_font" | "valuebox_font_icons" | "scrollbar" | "slider" | "folder" | "pattern_default_back" | "pattern_default_font" | "pattern_default_font_volume" | "pattern_default_font_panning" | "pattern_default_font_pitch" | "pattern_default_font_delay" | "pattern_default_font_global" | "pattern_default_font_other" | "pattern_default_font_dspfx" | "pattern_default_font_unused" | "pattern_highlighted_back" | "pattern_highlighted_font" | "pattern_highlighted_font_volume" | "pattern_highlighted_font_panning" | "pattern_highlighted_font_pitch" | "pattern_highlighted_font_delay" | "pattern_highlighted_font_global" | "pattern_highlighted_font_other" | "pattern_highlighted_font_dspfx" | "pattern_highlighted_font_unused" | "pattern_playposition_back" | "pattern_playposition_font" | "pattern_centerbar_back" | "pattern_centerbar_font" | "pattern_centerbar_back_standby" | "pattern_centerbar_font_standby" | "pattern_selection" | "pattern_standby_selection" | "pattern_mute_state" | "automation_grid" | "automation_line_edge" | "automation_line_fill" | "automation_point" | "automation_marker_play" | "automation_marker_single" | "automation_marker_pair" | "automation_marker_diamond" | "vumeter_meter" | "vumeter_meter_low" | "vumeter_meter_middle" | "vumeter_meter_high" | "vumeter_peak" | "vumeter_back_normal" | "vumeter_back_clipped" | "default_color_01" | "default_color_02" | "default_color_03" | "default_color_04" | "default_color_05" | "default_color_06" | "default_color_07" | "default_color_08" | "default_color_09" | "default_color_10" | "default_color_11" | "default_color_12" | "default_color_13" | "default_color_14" | "default_color_15" | "default_color_16"
ButtonStyle
"normal"
| "rounded"
| "rounded_bottom"
| "rounded_left"
| "rounded_right"
| "rounded_top"
-- Get/set the style a button should be displayed with. ButtonStyle: | "normal" -- (Default) | "rounded" -- rounded corners on all sides | "rounded_left" -- rounded left side | "rounded_right" -- rounded right side | "rounded_top" -- rounded left side | "rounded_bottom" -- rounded right side
ControlActive
Instead of making a control invisible, you can also make it inactive. Deactivated controls will still be shown, and will still show their currently assigned values, but will not allow changes. Most controls will display as "grayed out" to visualize the deactivated state.
ControlMidiMappingString
When set, the control will be highlighted when Renoise's MIDI mapping dialog is open. When clicked, it selects the specified string as a MIDI mapping target action. This target acton can either be one of the globally available mappings in Renoise, or those that were created by the tool itself. Target strings are not verified. When they point to nothing, the mapped MIDI message will do nothing and no error is fired.
NotifierFunction
fun()
RGBColor
{ 1 : integer
, 2 : integer
, 3 : integer
}
A table of 3 bytes (ranging from 0 to 255) representing the red, green and blue channels of a color. {0xFF, 0xFF, 0xFF} is white {165, 73, 35} is the red from the Renoise logo
TextFontStyle
"big"
| "bold"
| "code"
| "italic"
| "mono"
| "normal"
-- The style that the text should be displayed with. TextFontStyle: | "normal" -- (Default) | "big" -- big text | "bold" -- bold font | "italic" -- italic font | "mono" -- monospace font | "code" -- monospace code font
ThemeColor
"alternate_main_back"
| "alternate_main_font"
| "automation_grid"
| "automation_line_edge"
| "automation_line_fill"
| "automation_marker_diamond"
| "automation_marker_pair"
| "automation_marker_play"
| "automation_marker_single"
| "automation_point"
| "body_back"
| "body_font"
| "button_back"
| "button_font"
| "button_highlight_font"
| "default_color_01"
| "default_color_02"
| "default_color_03"
| "default_color_04"
| "default_color_05"
| "default_color_06"
| "default_color_07"
| "default_color_08"
| "default_color_09"
| "default_color_10"
| "default_color_11"
| "default_color_12"
| "default_color_13"
| "default_color_14"
| "default_color_15"
| "default_color_16"
| "folder"
| "main_back"
| "main_font"
| "midi_mapping_back"
| "midi_mapping_font"
| "pattern_centerbar_back"
| "pattern_centerbar_back_standby"
| "pattern_centerbar_font"
| "pattern_centerbar_font_standby"
| "pattern_default_back"
| "pattern_default_font"
| "pattern_default_font_delay"
| "pattern_default_font_dspfx"
| "pattern_default_font_global"
| "pattern_default_font_other"
| "pattern_default_font_panning"
| "pattern_default_font_pitch"
| "pattern_default_font_unused"
| "pattern_default_font_volume"
| "pattern_highlighted_back"
| "pattern_highlighted_font"
| "pattern_highlighted_font_delay"
| "pattern_highlighted_font_dspfx"
| "pattern_highlighted_font_global"
| "pattern_highlighted_font_other"
| "pattern_highlighted_font_panning"
| "pattern_highlighted_font_pitch"
| "pattern_highlighted_font_unused"
| "pattern_highlighted_font_volume"
| "pattern_mute_state"
| "pattern_playposition_back"
| "pattern_playposition_font"
| "pattern_selection"
| "pattern_standby_selection"
| "scrollbar"
| "selected_button_back"
| "selected_button_font"
| "selection_back"
| "selection_font"
| "slider"
| "standby_selection_back"
| "standby_selection_font"
| "strong_body_font"
| "tooltip_back"
| "tooltip_font"
| "valuebox_back"
| "valuebox_font"
| "valuebox_font_icons"
| "vumeter_back_clipped"
| "vumeter_back_normal"
| "vumeter_meter"
| "vumeter_meter_high"
| "vumeter_meter_low"
| "vumeter_meter_middle"
| "vumeter_peak"
-- The application theme's colors ThemeColor: | "main_back" | "main_font" | "alternate_main_back" | "alternate_main_font" | "body_back" | "body_font" | "strong_body_font" | "button_back" | "button_font" | "button_highlight_font" | "selected_button_back" | "selected_button_font" | "selection_back" | "selection_font" | "standby_selection_back" | "standby_selection_font" | "midi_mapping_back" | "midi_mapping_font" | "tooltip_back" | "tooltip_font" | "valuebox_back" | "valuebox_font" | "valuebox_font_icons" | "scrollbar" | "slider" | "folder" | "pattern_default_back" | "pattern_default_font" | "pattern_default_font_volume" | "pattern_default_font_panning" | "pattern_default_font_pitch" | "pattern_default_font_delay" | "pattern_default_font_global" | "pattern_default_font_other" | "pattern_default_font_dspfx" | "pattern_default_font_unused" | "pattern_highlighted_back" | "pattern_highlighted_font" | "pattern_highlighted_font_volume" | "pattern_highlighted_font_panning" | "pattern_highlighted_font_pitch" | "pattern_highlighted_font_delay" | "pattern_highlighted_font_global" | "pattern_highlighted_font_other" | "pattern_highlighted_font_dspfx" | "pattern_highlighted_font_unused" | "pattern_playposition_back" | "pattern_playposition_font" | "pattern_centerbar_back" | "pattern_centerbar_font" | "pattern_centerbar_back_standby" | "pattern_centerbar_font_standby" | "pattern_selection" | "pattern_standby_selection" | "pattern_mute_state" | "automation_grid" | "automation_line_edge" | "automation_line_fill" | "automation_point" | "automation_marker_play" | "automation_marker_single" | "automation_marker_pair" | "automation_marker_diamond" | "vumeter_meter" | "vumeter_meter_low" | "vumeter_meter_middle" | "vumeter_meter_high" | "vumeter_peak" | "vumeter_back_normal" | "vumeter_back_clipped" | "default_color_01" | "default_color_02" | "default_color_03" | "default_color_04" | "default_color_05" | "default_color_06" | "default_color_07" | "default_color_08" | "default_color_09" | "default_color_10" | "default_color_11" | "default_color_12" | "default_color_13" | "default_color_14" | "default_color_15" | "default_color_16"
ViewCursorShape
"busy"
| "change_value"
| "crosshair"
| "default"
| "drag"
| "drop"
| "edit_text"
| "empty"
| "erase"
| "extend_bottom"
| "extend_bottom_alias"
| "extend_left"
| "extend_left_alias"
| "extend_right"
| "extend_right_alias"
| "extend_top"
| "extend_top_alias"
| "marker"
| "move"
| "nodrop"
| "none"
| "pencil"
| "play"
| "resize_edge_diagonal_left"
| "resize_edge_diagonal_right"
| "resize_edge_horizontal"
| "resize_edge_vertical"
| "resize_horizontal"
| "resize_vertical"
| "zoom"
| "zoom_horizontal"
| "zoom_vertical"
-- The cursor cursor for this view which apears on mouse hover. -- Using a "none" shape will use use underlying view's cursor or the default cursor. ViewCursorShape: | "none" | "empty" | "default" | "change_value" | "edit_text" | "pencil" | "marker" | "crosshair" | "move" | "erase" | "play" | "drag" | "drop" | "nodrop" | "busy" | "resize_vertical" | "resize_horizontal" | "resize_edge_vertical" | "resize_edge_horizontal" | "resize_edge_diagonal_left" | "resize_edge_diagonal_right" | "extend_left" | "extend_right" | "extend_top" | "extend_bottom" | "extend_left_alias" | "extend_right_alias" | "extend_top_alias" | "extend_bottom_alias" | "zoom_vertical" | "zoom_horizontal" | "zoom"
ViewDimension
The dimensions of a view has to be larger than 0. For nested views you can also specify relative size for example
vb:text { width = "80%"}
. The percentage values are relative to the view's parent size and will automatically update on size changes.
ViewOrigin
{ 1 : ViewPosition
, 2 : ViewPosition
} | { x : ViewPosition
, y : ViewPosition
}
The position of a view within its parent view. Only the
stack
layouts allows to freely position child views. Other layout views will automatically set the origin, but the origin then still can be read in for example mouse handlers.
ViewPosition
Horizontal (x) or Vertical (y) position of a view within its parent view.
ViewSize
{ 1 : ViewDimension
, 2 : ViewDimension
} | { height : ViewDimension
, width : ViewDimension
}
The dimensions of a view has to be larger than 0. For nested views you can also specify relative size, for example
vb:text { size = { width = "80%", height = 20}}
. The percentage values are relative to the view's parent size and will automatically update when the parent view's size changes.
ViewTooltip
A ViewTooltip text that should be shown for this view on mouse hover.
- Default: "" (no tip will be shown)
ViewVisibility
Set visible to false to hide a view (make it invisible without removing it). Please note that view.visible will also return false when any of its parents are invisible (when its implicitly invisible).
- Default: true