summaryrefslogtreecommitdiff
path: root/src/widget/button.c
blob: f2313fd7803fc2729fb9df1f4f238cff5cb6a382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <ui.h>

#include "widget.h"

uiButton* uiMakeButton(const char* text) {
  assert(text);

  uiButton* button = UI_NEW(uiButton);

  *button = (uiButton){
      .widget =
          (uiWidget){
                     .type = uiTypeButton,
                     .rect = {0},
                     },
      .text = string_new(text),
  };
  return button;
}