ui/gtk/toolkit.c

changeset 24
06bceda81a03
parent 21
012418e7dc90
child 27
77b09bb52ca0
equal deleted inserted replaced
23:decc6bf584aa 24:06bceda81a03
30 #include <stdlib.h> 30 #include <stdlib.h>
31 31
32 #include "toolkit.h" 32 #include "toolkit.h"
33 #include "toolbar.h" 33 #include "toolbar.h"
34 #include "../common/document.h" 34 #include "../common/document.h"
35 #include "../common/properties.h"
35 36
36 static char *application_name; 37 static char *application_name;
37 38
38 static ui_callback appclose_fnc; 39 static ui_callback appclose_fnc;
39 static void *appclose_udata; 40 static void *appclose_udata;
45 uic_docmgr_init(); 46 uic_docmgr_init();
46 ui_toolbar_init(); 47 ui_toolbar_init();
47 48
48 // init custom types 49 // init custom types
49 //ui_list_init(); 50 //ui_list_init();
51
52 uic_load_app_properties();
50 } 53 }
51 54
52 void ui_exitfunc(ui_callback f, void *udata) { 55 void ui_exitfunc(ui_callback f, void *udata) {
53 appclose_fnc = f; 56 appclose_fnc = f;
54 appclose_udata = udata; 57 appclose_udata = udata;
55 } 58 }
56 59
60 char* ui_appname() {
61 return application_name;
62 }
63
57 void ui_main() { 64 void ui_main() {
58 gtk_main(); 65 gtk_main();
59 if(appclose_fnc) { 66 if(appclose_fnc) {
60 appclose_fnc(NULL, appclose_udata); 67 appclose_fnc(NULL, appclose_udata);
61 } 68 }
69 uic_store_app_properties();
62 } 70 }
63 71
64 void ui_show(UiObject *obj) { 72 void ui_show(UiObject *obj) {
65 uic_check_group_widgets(obj->ctx); 73 uic_check_group_widgets(obj->ctx);
66 gtk_widget_show_all(obj->widget); 74 gtk_widget_show_all(obj->widget);

mercurial