Created
August 3, 2017 20:49
-
-
Save computermouth/0f300433bfd3dee765f94eb5bc030081 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
#include "whatever.h" | |
int init_page(){ | |
char *h_content = "this is some header"; | |
char *pre_content = | |
"// example code" | |
"int a = 0;" | |
"a++;"; | |
char *para_content = "This is an explanation of the code to my left"; | |
char *button_content = "push me" | |
char *button_id = "button_a" | |
web( | |
row12( | |
column6( | |
row12(header(h_content, MACRO_H3 | MACRO_STYLE1 | MACRO_FONT2)), | |
row12(pre(pre_content, MACRO_PRE | MACRO_STYLE2 | MACRO_FONT3)) | |
), | |
column6( | |
row12(para(para_content, MACRO_P | MACRO_STYLE1 | MACRO_FONT5)), | |
row12( | |
column5(SPACER) | |
column2(button(button_content, button_id, MACRO_BUTT | MACRO_STYLE2 | MACRO_FONT5)) | |
column5(SPACER) | |
), | |
), | |
); | |
} | |
int called_from_js(WebEvent *e){ | |
while(e)( | |
if (e->type == button){ | |
if (e->type.button.id == "button_a"){ | |
// do some shit | |
// maybe edit other elements by ID | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment