Last active
January 19, 2017 15:51
-
-
Save pervognsen/47757488871fa0e43585b7886a001ef4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct { | |
const char *text; // in | |
image_t *image; // in | |
int pressed; // out | |
int released; // out | |
} button_t; | |
void do_button(button_t *); | |
#define button(name, ...) button_t name = {__VA_ARGS__}; do_button(&name) | |
button(load_button, .text = "Load File"); | |
if (load_button.released) | |
load_file(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment