summaryrefslogtreecommitdiff
path: root/clients/resizor.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-01-06 21:59:05 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-01-06 22:03:44 -0500
commit4f7dcd6eb18ea708f172a9e0239992f49c6860d2 (patch)
treead658c510e29ba558c37c5facd1dcc8805247536 /clients/resizor.c
parent249713bbe0ebb046c091d8cb2ec9ed7b70eb3923 (diff)
downloadweston-4f7dcd6eb18ea708f172a9e0239992f49c6860d2.tar.gz
window: Add a window menu
At least this gives us a way to close the toy toolkit clients.
Diffstat (limited to 'clients/resizor.c')
-rw-r--r--clients/resizor.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clients/resizor.c b/clients/resizor.c
index 867ceb90..10378241 100644
--- a/clients/resizor.c
+++ b/clients/resizor.c
@@ -167,6 +167,12 @@ key_handler(struct window *window, struct input *input, uint32_t time,
}
static void
+menu_func(struct window *window, int index, void *user_data)
+{
+ fprintf(stderr, "picked entry %d\n", index);
+}
+
+static void
show_menu(struct resizor *resizor, struct input *input, uint32_t time)
{
int32_t x, y;
@@ -177,7 +183,8 @@ show_menu(struct resizor *resizor, struct input *input, uint32_t time)
input_get_position(input, &x, &y);
resizor->menu = window_create_menu(resizor->display,
input, time, resizor->window,
- x - 10, y - 10, entries, 4);
+ x - 10, y - 10,
+ menu_func, entries, 4);
window_schedule_redraw(resizor->menu);
}