Skip to content

Instantly share code, notes, and snippets.

@pervognsen
Last active January 19, 2017 15:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pervognsen/47757488871fa0e43585b7886a001ef4 to your computer and use it in GitHub Desktop.
Save pervognsen/47757488871fa0e43585b7886a001ef4 to your computer and use it in GitHub Desktop.
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