diff -r 86d729874ff4 -r a4f4123ca12a ui/motif/window.c --- a/ui/motif/window.c Sat Jan 23 18:37:30 2016 +0100 +++ b/ui/motif/window.c Sat Jan 23 20:47:07 2016 +0100 @@ -48,7 +48,7 @@ } } -UiObject* ui_window(char *title, void *window_data) { +static UiObject* create_window(char *title, void *window_data, UiBool simple) { UcxMempool *mp = ucx_mempool_new(256); UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); obj->ctx = uic_context(obj, mp); @@ -87,24 +87,23 @@ // TODO: use callback ui_set_active_window(toplevel); - // menu Widget window = XtVaCreateManagedWidget( title, xmMainWindowWidgetClass, toplevel, NULL); obj->widget = window; - ui_create_menubar(obj); - - // toolbar Widget form = XtVaCreateManagedWidget( "window_form", xmFormWidgetClass, window, NULL); + Widget toolbar = NULL; - Widget toolbar = ui_create_toolbar(obj, form); - + if(!simple) { + ui_create_menubar(obj); + toolbar = ui_create_toolbar(obj, form); + } // window content XtSetArg(args[0], XmNshadowType, XmSHADOW_ETCHED_OUT); @@ -134,6 +133,14 @@ return obj; } +UiObject* ui_window(char *title, void *window_data) { + return create_window(title, window_data, FALSE); +} + +UiObject* ui_simplewindow(char *title, void *window_data) { + return create_window(title, window_data, TRUE); +} + void ui_close(UiObject *obj) { XtDestroyWidget(obj->widget); window_close_handler(obj->widget, obj, NULL);