Skip to main content

button

Macro button 

Source
button!() { /* proc-macro */ }
Expand description

Creates a new button control. The format is button!("attributes") where the attributes are pairs of key-value , separated by comma, in the format key=value or key:value. If the value is a string, use single quotes to delimit the value. The following attributes are supported:

  • name or caption or text - the text displayed on the button
  • type - the type of the button. The following values are supported:
    • Normal - a normal button
    • Flat - a flat button
  • position attributes: x and y,
  • size attributes: width or w (alias)
  • margin attributes: left or l(alias), right or r(alias), top or t(alias), bottom or b(alias)
  • Alignment attributes:
    • align or a(alias) - one of Left, Right, Top, Bottom, Center, TopLeft, TopRight, BottomLeft, BottomRight
    • dock or d(alias) - one of Left, Right, Top, Bottom, Center, TopLeft, TopRight, BottomLeft, BottomRight
  • State attributes: enabled, visible

ยงExample

button!("caption='Click me!', type=Flat, x=10, y=10, width=20")

Alternatively, the first parameter (if the key is not specified) is consider the caption:

button!("'Click me!', x:0, y=10, w:20")