summaryrefslogtreecommitdiff
path: root/clients/resizor.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-12-19 15:40:10 -0500
committerKristian Høgsberg <krh@bitplanet.net>2011-12-19 15:40:10 -0500
commitbbedd7e9d2e7409d3ca99a85eaf4bcc98957c425 (patch)
treefca45489f8afb0d06ef35f70bfc762c6a4db8cc8 /clients/resizor.c
parent8da0fbde12e2c1ce07ece6f8b2b9a5a9a9ca3ff4 (diff)
downloadweston-bbedd7e9d2e7409d3ca99a85eaf4bcc98957c425.tar.gz
weston-bbedd7e9d2e7409d3ca99a85eaf4bcc98957c425.tar.bz2
weston-bbedd7e9d2e7409d3ca99a85eaf4bcc98957c425.zip
clients: Implement a toy-menu for testing the menu surface type
Diffstat (limited to 'clients/resizor.c')
-rw-r--r--clients/resizor.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/clients/resizor.c b/clients/resizor.c
index 87c7af3f..a31e0d73 100644
--- a/clients/resizor.c
+++ b/clients/resizor.c
@@ -157,15 +157,17 @@ key_handler(struct window *window, struct input *input, uint32_t time,
static void
show_menu(struct resizor *resizor, struct input *input)
{
- int32_t x, y, width = 200, height = 200;
+ int32_t x, y;
+ static const char *entries[] = {
+ "Roy", "Pris", "Leon", "Zhora"
+ };
input_get_position(input, &x, &y);
- resizor->menu = window_create_transient(resizor->display,
- resizor->window,
- x - 10, y - 10, width, height);
+ resizor->menu = window_create_menu(resizor->display,
+ resizor->window,
+ x - 10, y - 10, entries, 4);
- window_draw(resizor->menu);
- window_flush(resizor->menu);
+ window_schedule_redraw(resizor->menu);
}
static void
@@ -179,8 +181,6 @@ button_handler(struct window *window,
case BTN_RIGHT:
if (state)
show_menu(resizor, input);
- else
- window_destroy(resizor->menu);
break;
}
}