Rhombus

|
class gui.Button(): | implements WindowChildView | constructor ( | label :: ObsOrValue.of(View.LabelString | || draw.Bitmap | || [draw.Bitmap, | View.LabelString, | Button.LabelPosition]), | ~action: action :: () -> ~any = fun (): #void, | ~style: style :: 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], | ~enable: enable :: ObsOrValue.of(Boolean) = #true, | ~window_callbacks: window_callbacks :: maybe(WindowCallbacks) = #false | ) |
|
Creates a button. Buttons with bitmap labels (or a combination of
bitmap and text) tend to have a different style than buttons with text
labels. See
View.LabelString for information about
keyboard mnemonics in
label.
The action function is called when the button is clicked by a
user.
See Geometry Management for information about ~margin,
~min_size, and ~stretch.
The ~window_callbacks argument configures
callbacks that are common to all WindowChildViews.
See WindowCallbacks for more information.
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.