diff options
Diffstat (limited to 'src/widget/button.c')
| -rw-r--r-- | src/widget/button.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widget/button.c b/src/widget/button.c index f2313fd..d8de266 100644 --- a/src/widget/button.c +++ b/src/widget/button.c | |||
| @@ -2,18 +2,21 @@ | |||
| 2 | 2 | ||
| 3 | #include "widget.h" | 3 | #include "widget.h" |
| 4 | 4 | ||
| 5 | uiButton* uiMakeButton(const char* text) { | 5 | uiButton* uiMakeButton(uiPtr parent, const char* text, const uiParams* params) { |
| 6 | assert(text); | 6 | assert(text); |
| 7 | assert(params); | ||
| 7 | 8 | ||
| 8 | uiButton* button = UI_NEW(uiButton); | 9 | uiButton* button = UI_NEW(uiButton); |
| 9 | 10 | ||
| 10 | *button = (uiButton){ | 11 | *button = (uiButton){ |
| 11 | .widget = | 12 | .widget = |
| 12 | (uiWidget){ | 13 | (uiWidget){ |
| 13 | .type = uiTypeButton, | 14 | .type = uiTypeButton, |
| 14 | .rect = {0}, | 15 | .rect = {0}, |
| 16 | .stretch = params->stretch, | ||
| 15 | }, | 17 | }, |
| 16 | .text = string_new(text), | 18 | .text = string_new(text), |
| 17 | }; | 19 | }; |
| 20 | WidgetSetParent(uiMakeButtonPtr(button), parent); | ||
| 18 | return button; | 21 | return button; |
| 19 | } | 22 | } |
