diff options
| author | Federico Angelilli <code@fedang.net> | 2023-11-17 17:48:03 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-11-17 17:48:03 +0100 |
| commit | fe3ed50e1da2bb4ced3172e86a3b244a9c3d4f1c (patch) | |
| tree | d78e5535144910508eb0c629253f386f16dcffe5 /src/button.h | |
| parent | 032af5aeb9bd80b933672ca4b5360c33baa8d42e (diff) | |
Add buttons and update draw
Diffstat (limited to 'src/button.h')
| -rw-r--r-- | src/button.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/button.h b/src/button.h new file mode 100644 index 0000000..11b6507 --- /dev/null +++ b/src/button.h @@ -0,0 +1,26 @@ +#ifndef COMET_BUTTON_H +#define COMET_BUTTON_H + +#include <stdbool.h> + +// TODO: Generic button shapes/actions + +typedef struct Button Button; + +typedef void (* ButtonAction)(Button *btn); + +struct Button { + bool fixed_size; + ButtonAction action; + char *text; +}; + +Button *button_create(const char *text, bool fixed_size); + +void button_set_action(Button *btn, ButtonAction action); + +void button_destroy(Button *btn); + +#endif + +// vim: ts=4 sw=4 et |
