
|
class gui.Button(): | implements WindowChildView | constructor ( | label :: ObsOrValue.of(View.LabelString | || draw.Bitmap | || [draw.Bitmap, | View.LabelString, | Button.LabelPosition]), | ~action: action :: () -> ~any = fun (): #void, | ~enable: enable :: ObsOrValue.of(Boolean) = #true, | ~styles: styles :: List.of(Button.Style) = [], | ~font : font :: draw.Font = View.normal_control_font, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#false, #false], | ~window_callbacks: window_callbacks :: maybe(WindowCallbacks) = #false | ) |
|
Creates a button. When rendered, the function call action()
is performed when the button is clicked.
A button style option:
#'default: The button is the default action,
especially in a Dialog where the Return key
automatically has the effect of clicking a default button.
#'multi_line: Newline characters in the button’s label
can create a line break in the button’s label.
A button label-position option for text combined with an image.