aboutsummaryrefslogtreecommitdiff
path: root/example/example.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-08-07 19:21:25 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-08-07 19:21:25 +0200
commitdbfdd29ce534dcacf069223612d8bb7febab40e0 (patch)
tree4d2a50e1730a94105fd0d9a867bbe4465b0010d6 /example/example.c
parent745820dd18d62286cb9bb8c2d83c5fb00afef649 (diff)
downloadd2tk-dbfdd29ce534dcacf069223612d8bb7febab40e0.tar.xz
base: prototype link widget.
Diffstat (limited to 'example/example.c')
-rw-r--r--example/example.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/example/example.c b/example/example.c
index b13a026..a5bd63c 100644
--- a/example/example.c
+++ b/example/example.c
@@ -91,7 +91,7 @@ static const char *bar_lbl [BAR_MAX] = {
static inline void
_render_c_mix(d2tk_base_t *base, const d2tk_rect_t *rect)
{
-#define N 14
+#define N 15
#define M 24
static val_t value [N*M];
@@ -230,6 +230,17 @@ _render_c_mix(d2tk_base_t *base, const d2tk_rect_t *rect)
d2tk_base_bitmap(base, 2, 2, 2*sizeof(uint32_t), argb, rev, bnd,
D2TK_ALIGN_CENTERED);
} break;
+ case 14:
+ {
+ char lbl [32];
+ const size_t lbl_len = snprintf(lbl, sizeof(lbl), "%03X", k);
+
+ if(d2tk_base_link_is_changed(base, id, lbl_len, lbl, 0.5f, bnd,
+ D2TK_ALIGN_MIDDLE | D2TK_ALIGN_LEFT))
+ {
+ fprintf(stdout, "link %016"PRIx64" DOWN\n", id);
+ }
+ } break;
default:
{
// nothing to do