36 #include "../ui/window.h" |
36 #include "../ui/window.h" |
37 #include "../common/context.h" |
37 #include "../common/context.h" |
38 |
38 |
39 static int nwindows = 0; |
39 static int nwindows = 0; |
40 |
40 |
41 static int window_default_width = 650; |
41 static int window_default_width = 600; |
42 static int window_default_height = 550; |
42 static int window_default_height = 500; |
43 |
43 |
44 static void window_close_handler(Widget window, void *udata, void *cdata) { |
44 static void window_close_handler(Widget window, void *udata, void *cdata) { |
45 nwindows--; |
45 nwindows--; |
46 if(nwindows == 0) { |
46 if(nwindows == 0) { |
47 ui_exit_mainloop(); |
47 ui_exit_mainloop(); |
55 |
55 |
56 Arg args[16]; |
56 Arg args[16]; |
57 int n = 0; |
57 int n = 0; |
58 |
58 |
59 XtSetArg(args[0], XmNtitle, title); |
59 XtSetArg(args[0], XmNtitle, title); |
60 XtSetArg(args[1], XmNbaseWidth, window_default_width); |
60 //XtSetArg(args[1], XmNbaseWidth, window_default_width); |
61 XtSetArg(args[2], XmNbaseHeight, window_default_height); |
61 //XtSetArg(args[2], XmNbaseHeight, window_default_height); |
|
62 XtSetArg(args[1], XmNminWidth, 100); |
|
63 XtSetArg(args[2], XmNminHeight, 50); |
|
64 XtSetArg(args[3], XmNwidth, window_default_width); |
|
65 XtSetArg(args[4], XmNheight, window_default_height); |
62 |
66 |
63 Widget toplevel = XtAppCreateShell( |
67 Widget toplevel = XtAppCreateShell( |
64 "Test123", |
68 "Test123", |
65 "abc", |
69 "abc", |
66 //applicationShellWidgetClass, |
70 //applicationShellWidgetClass, |
67 vendorShellWidgetClass, |
71 vendorShellWidgetClass, |
68 ui_get_display(), |
72 ui_get_display(), |
69 args, |
73 args, |
70 3); |
74 5); |
71 |
75 |
72 Atom wm_delete_window; |
76 Atom wm_delete_window; |
73 wm_delete_window = XmInternAtom( |
77 wm_delete_window = XmInternAtom( |
74 XtDisplay(toplevel), |
78 XtDisplay(toplevel), |
75 "WM_DELETE_WINDOW", |
79 "WM_DELETE_WINDOW", |