58 |
58 |
59 UiTextLayout *text; |
59 UiTextLayout *text; |
60 |
60 |
61 void action_scroll(UiEvent *event, void *data) { |
61 void action_scroll(UiEvent *event, void *data) { |
62 ui_drawingarea_redraw(drawingarea); |
62 ui_drawingarea_redraw(drawingarea); |
|
63 printf("scroll\n"); |
63 } |
64 } |
64 |
65 |
65 void draw(UiEvent *event, UiGraphics *g, void *data) { |
66 void draw(UiEvent *event, UiGraphics *g, void *data) { |
66 double adjust = range.get(&range); |
67 double adjust = range.get(&range); |
67 |
68 |
140 ui_context_closefunc(obj->ctx, window_close, NULL); |
141 ui_context_closefunc(obj->ctx, window_close, NULL); |
141 |
142 |
142 ///* |
143 ///* |
143 ui_hbox(obj); |
144 ui_hbox(obj); |
144 |
145 |
|
146 //* |
|
147 ui_vbox(obj); |
145 drawingarea = ui_drawingarea(obj, draw, NULL); |
148 drawingarea = ui_drawingarea(obj, draw, NULL); |
146 ctxmenu = ui_contextmenu_w(obj, drawingarea); |
149 ctxmenu = ui_contextmenu_w(obj, drawingarea); |
147 ui_widget_menuitem(obj, "Test1", NULL, NULL); |
150 ui_widget_menuitem(obj, "Test1", NULL, NULL); |
148 ui_widget_menuitem(obj, "Test2", NULL, NULL); |
151 ui_widget_menuitem(obj, "Test2", NULL, NULL); |
149 ui_widget_menuitem(obj, "Test3", NULL, NULL); |
152 ui_widget_menuitem(obj, "Test3", NULL, NULL); |
150 ui_widget_menuitem(obj, "Test4", NULL, NULL); |
153 ui_widget_menuitem(obj, "Test4", NULL, NULL); |
151 ui_drawingarea_mousehandler(obj, drawingarea, click, NULL); |
154 ui_drawingarea_mousehandler(obj, drawingarea, click, NULL); |
|
155 ui_end(obj); |
|
156 //*/ |
152 |
157 |
153 ui_vscrollbar(obj, &range, action_scroll, NULL); |
158 ui_vscrollbar(obj, &range, action_scroll, NULL); |
154 range.setrange(&range, 0, 400); |
159 range.setrange(&range, 0, 100); |
155 range.setextent(&range, 1); |
160 range.setextent(&range, 20); |
156 range.set(&range, 0); |
161 range.set(&range, 0); |
157 |
162 |
158 ui_end(obj); |
163 ui_end(obj); |
159 //*/ |
164 //*/ |
160 |
165 |