diff options
| author | Federico Angelilli <code@fedang.net> | 2023-11-26 21:26:03 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-11-26 21:26:03 +0100 |
| commit | 238bedb3f4d3a356a6cd11cd8b4c5a2725de2cf8 (patch) | |
| tree | d5b74c202aa364ccdd4d7e3d3423bbcf00420330 /src/comet.c | |
| parent | f1fe3ce9e29a1dcb4000bedce6eb9bdeebd08f59 (diff) | |
Implement button groups
Diffstat (limited to 'src/comet.c')
| -rw-r--r-- | src/comet.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/comet.c b/src/comet.c index 8fd5095..07fb8cf 100644 --- a/src/comet.c +++ b/src/comet.c @@ -307,6 +307,21 @@ int main(int argc, char **argv) button_simple_set_action(q_btn, quit_action, mainloop); state_add_button(state, q_btn); + // Test button group + Button *child1 = button_simple_create(PANGO_ALIGN_CENTER, color, line_color); + button_simple_set_text(child1, "C1", text_color); + button_simple_set_action(child1, show_action, &date_ctx); + + Button *child2 = button_simple_create(PANGO_ALIGN_CENTER, color, line_color); + button_simple_set_text(child2, "C2", text_color); + button_simple_set_action(child2, show_action, &date_ctx); + + Color orange = { 1, 0.647, 0, 1 }; + Button *group = button_group_create(PANGO_ALIGN_LEFT, orange, line_color); + button_group_append(group, child1); + button_group_append(group, child2); + state_add_button(state, group); + connect_attach_state(con, state); connect_attach_source(con); |
