Skip to content

UI.Button

Name - Description Default Type
<input> The value that will be passed to the Action shards of the button. Any
<output> Indicates whether the button was clicked during this frame. Bool
Label The text label of this button. None String
Action The shards to execute when the button is pressed. None Shard[ Shard ]
Wrap Wrap the text depending on the layout. None Bool
Style The text style. None { Any }&{ Any }

Clickable button with text.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
(GFX.MainWindow
 :Contents
 (->
  (Setup
   (GFX.DrawQueue) >= .ui-draw-queue
   (GFX.UIPass .ui-draw-queue) >> .render-steps)
  (UI
   .ui-draw-queue
   (UI.CentralPanel
    (UI.Button
     :Label "Click me!"
     :Action (Msg "Clicked"))))

  (GFX.Render :Steps .render-steps)))

 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
(GFX.MainWindow
 :Contents
 (->
  (Setup
   (GFX.DrawQueue) >= .ui-draw-queue
   (GFX.UIPass .ui-draw-queue) >> .render-steps)
  (UI
   .ui-draw-queue
   (UI.CentralPanel
    (UI.Button
     :Label "Click me!"
     :Style {:color (color 255 255 0)}
     :Action (Msg "Clicked"))))

  (GFX.Render :Steps .render-steps)))