ui/motif/toolkit.c

changeset 36
e4198fc2ead4
parent 34
0ec8a5f17782
child 46
4a5e0b9b6992
equal deleted inserted replaced
35:3e8b5c9b4033 36:e4198fc2ead4
81 81
82 if(pipe(event_pipe)) { 82 if(pipe(event_pipe)) {
83 fprintf(stderr, "UiError: Cannot create event pipe\n"); 83 fprintf(stderr, "UiError: Cannot create event pipe\n");
84 exit(-1); 84 exit(-1);
85 } 85 }
86 XtAppAddInput(app, event_pipe[0], XtInputReadMask, input_proc, NULL); 86 XtAppAddInput(
87 app,
88 event_pipe[0],
89 (XtPointer)XtInputReadMask,
90 input_proc,
91 NULL);
87 } 92 }
88 93
89 char* ui_appname() { 94 char* ui_appname() {
90 return application_name; 95 return application_name;
91 } 96 }
107 XtAppMainLoop(app); 112 XtAppMainLoop(app);
108 if(appclose_fnc) { 113 if(appclose_fnc) {
109 appclose_fnc(NULL, appclose_udata); 114 appclose_fnc(NULL, appclose_udata);
110 } 115 }
111 uic_store_app_properties(); 116 uic_store_app_properties();
117 }
118
119 void ui_exit_mainloop() {
120 XtAppSetExitFlag(app);
112 } 121 }
113 122
114 void ui_secondary_event_loop(int *loop) { 123 void ui_secondary_event_loop(int *loop) {
115 while(*loop && !XtAppGetExitFlag(app)) { 124 while(*loop && !XtAppGetExitFlag(app)) {
116 XEvent event; 125 XEvent event;
122 void ui_show(UiObject *obj) { 131 void ui_show(UiObject *obj) {
123 uic_check_group_widgets(obj->ctx); 132 uic_check_group_widgets(obj->ctx);
124 XtRealizeWidget(obj->widget); 133 XtRealizeWidget(obj->widget);
125 } 134 }
126 135
127 void ui_close(UiObject *obj) { 136 // implemented in window.c
128 // TODO 137 //void ui_close(UiObject *obj)
129 }
130 138
131 void ui_set_enabled(UIWIDGET widget, int enabled) { 139 void ui_set_enabled(UIWIDGET widget, int enabled) {
132 XtSetSensitive(widget, enabled); 140 XtSetSensitive(widget, enabled);
133 } 141 }
134 142

mercurial