| 77 const CxAllocator *a = mp->allocator; |
79 const CxAllocator *a = mp->allocator; |
| 78 UiObject *obj = uic_object_new_toplevel(); |
80 UiObject *obj = uic_object_new_toplevel(); |
| 79 obj->window = window_data; |
81 obj->window = window_data; |
| 80 obj->destroy = ui_window_widget_destroy; |
82 obj->destroy = ui_window_widget_destroy; |
| 81 |
83 |
| |
84 int window_width = window_default_width; |
| |
85 int window_height = window_default_height; |
| |
86 if(!simple) { |
| |
87 ui_get_window_default_width(&window_width, &window_height); |
| |
88 } |
| |
89 |
| 82 Arg args[16]; |
90 Arg args[16]; |
| 83 int n = 0; |
91 int n = 0; |
| 84 XtSetArg(args[n], XmNtitle, title); n++; |
92 XtSetArg(args[n], XmNtitle, title); n++; |
| 85 XtSetArg(args[n], XmNminWidth, 100); n++; |
93 XtSetArg(args[n], XmNminWidth, 100); n++; |
| 86 XtSetArg(args[n], XmNminHeight, 50); n++; |
94 XtSetArg(args[n], XmNminHeight, 50); n++; |
| 87 XtSetArg(args[n], XmNwidth, window_default_width); n++; |
95 XtSetArg(args[n], XmNwidth, window_width); n++; |
| 88 XtSetArg(args[n], XmNheight, window_default_height); n++; |
96 XtSetArg(args[n], XmNheight, window_height); n++; |
| 89 |
97 |
| 90 Widget toplevel = XtAppCreateShell( |
98 Widget toplevel = XtAppCreateShell( |
| 91 ui_appname(), |
99 ui_appname(), |
| 92 "mainwindow", |
100 "mainwindow", |
| 93 //applicationShellWidgetClass, |
101 //applicationShellWidgetClass, |
| 144 return create_window(title, window_data, FALSE); |
152 return create_window(title, window_data, FALSE); |
| 145 } |
153 } |
| 146 |
154 |
| 147 UiObject* ui_simple_window(const char *title, void *window_data) { |
155 UiObject* ui_simple_window(const char *title, void *window_data) { |
| 148 return create_window(title, window_data, TRUE); |
156 return create_window(title, window_data, TRUE); |
| |
157 } |
| |
158 |
| |
159 void ui_window_size(UiObject *obj, int width, int height) { |
| |
160 XtVaSetValues(obj->widget, XmNwidth, width, XmNheight, height, NULL); |
| |
161 } |
| |
162 |
| |
163 void ui_window_default_size(int width, int height) { |
| |
164 window_default_width = width; |
| |
165 window_default_height = height; |
| |
166 } |
| |
167 |
| |
168 void ui_window_menubar_set_visible(UiObject *obj, UiBool visible) { |
| |
169 |
| 149 } |
170 } |
| 150 |
171 |
| 151 static void filedialog_event(UiEventData *event, int result, UiFileList flist) { |
172 static void filedialog_event(UiEventData *event, int result, UiFileList flist) { |
| 152 UiEvent evt; |
173 UiEvent evt; |
| 153 evt.obj = event->obj; |
174 evt.obj = event->obj; |