aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-02-04 22:58:04 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-02-04 22:58:04 +0100
commit87aa071b938e1098658cc02ad403c146f45d31b4 (patch)
treee80ecc2e1890e33a1345d6375add34c3213d44a0 /example
parent344d7b8d9c761a99b55a3fe9745c7a7483a6c4c3 (diff)
downloadd2tk-87aa071b938e1098658cc02ad403c146f45d31b4.tar.xz
base: turn flowmatrix node into container.
Diffstat (limited to 'example')
-rw-r--r--example/example.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/example/example.c b/example/example.c
index ed4253b..8ebc7c9 100644
--- a/example/example.c
+++ b/example/example.c
@@ -451,11 +451,19 @@ _render_c_flowmatrix(d2tk_base_t *base, const d2tk_rect_t *rect)
{
for(unsigned i = 0; i < N; i++)
{
- char lbl [32];
+ d2tk_state_t state = D2TK_STATE_NONE;
+ D2TK_BASE_FLOWMATRIX_NODE(base, flowm, &pos_nodes[i], node, &state)
+ {
+ char lbl [32];
+ const ssize_t lbl_len = snprintf(lbl, sizeof(lbl), "Node %u", i);
+ const d2tk_rect_t *bnd = d2tk_flowmatrix_node_get_rect(node);
- const ssize_t lbl_len = snprintf(lbl, sizeof(lbl), "Node %i", i);
- d2tk_flowmatrix_node(base, flowm, &pos_nodes[i], D2TK_ID_IDX(i),
- lbl_len, lbl, 0, 2);
+ state = d2tk_base_button_label(base, D2TK_ID_IDX(i), lbl_len, lbl, bnd);
+ if(d2tk_state_is_changed(state))
+ {
+ fprintf(stderr, "Node %u pressed\n", i);
+ }
+ }
}
for(unsigned i = 0; i < N; i++)