application/main.c

branch
newapi
changeset 402
96a055be7f0b
parent 390
b130f80ec7f9
child 404
384f6d1f5784
equal deleted inserted replaced
401:55fb6bad549d 402:96a055be7f0b
111 111
112 void action_dialog_button(UiEvent *event, void *userdata) { 112 void action_dialog_button(UiEvent *event, void *userdata) {
113 ui_close(event->obj); 113 ui_close(event->obj);
114 } 114 }
115 115
116 void action_dialog_onactivate(UiEvent *event, void *userdata) {
117 printf("textfield activate\n");
118 ui_close(event->obj);
119 }
120
116 void action_toolbar_dialog(UiEvent *event, void *userdata) { 121 void action_toolbar_dialog(UiEvent *event, void *userdata) {
117 122
118 UiObject *dialog = ui_dialog_window(event->obj, .title = "Dialog Window", .lbutton1 = "Cancel 1", .lbutton2 = "Btn2", .rbutton3 = "Btn3", .rbutton4 = "Login 4", .onclick = action_dialog_button, .default_button = 4, .show_closebutton = UI_OFF); 123 UiObject *dialog = ui_dialog_window(event->obj, .title = "Dialog Window", .lbutton1 = "Cancel 1", .lbutton2 = "Btn2", .rbutton3 = "Btn3", .rbutton4 = "Login 4", .onclick = action_dialog_button, .default_button = 4, .show_closebutton = UI_OFF);
119 124
120 ui_vbox(dialog, .margin = 10, .spacing = 10) { 125 ui_vbox(dialog, .margin = 10, .spacing = 10) {
121 ui_label(dialog, .label = "Enter password:"); 126 ui_label(dialog, .label = "Enter password:");
122 ui_passwordfield(dialog, .varname = "password"); 127 ui_passwordfield(dialog, .varname = "password", .onactivate = action_dialog_onactivate);
123 } 128 }
124 129
125 ui_show(dialog); 130 ui_show(dialog);
126 } 131 }
127 132

mercurial