6 static void display(Window *win);
7 static void keyboard(Window *win, int key, bool pressed);
8 static void button(Window *win, int bn, bool pressed, int x, int y);
9 static void motion(Window *win, int x, int y);
10 static void cleanup();
17 Window *win1 = new Window;
18 win1->set_title("title1");
20 win1->resize(200, 300);
21 win1->set_display_callback(display);
22 win1->set_keyboard_callback(keyboard);
23 win1->set_mouse_button_callback(button);
24 win1->set_mouse_motion_callback(motion);
33 static void display(Window *win)
35 if(wm->get_focused_window() != win) {
36 fill_rect(win->get_absolute_rect(), 106, 106, 250);
39 fill_rect(win->get_absolute_rect(), 0, 0, 255);
43 static void keyboard(Window *win, int key, bool pressed)
51 static void button(Window *win, int bn, bool pressed, int x, int y)
53 printf("WINDOW(%p) button %d %s\n", (void*)win, bn, pressed ? "press" : "release");
56 static void motion(Window *win, int x, int y)
58 printf("WINDOW(%p) motion %d %d\n", (void*)win, x, y);