application/main.c

branch
newapi
changeset 402
96a055be7f0b
parent 390
b130f80ec7f9
child 404
384f6d1f5784
--- a/application/main.c	Fri Nov 29 22:02:38 2024 +0100
+++ b/application/main.c	Sat Nov 30 20:13:09 2024 +0100
@@ -113,13 +113,18 @@
     ui_close(event->obj);
 }
 
+void action_dialog_onactivate(UiEvent *event, void *userdata) {
+    printf("textfield activate\n");
+    ui_close(event->obj);
+}
+
 void action_toolbar_dialog(UiEvent *event, void *userdata) {
     
     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);
     
     ui_vbox(dialog, .margin = 10, .spacing = 10) {
         ui_label(dialog, .label = "Enter password:");
-        ui_passwordfield(dialog, .varname = "password");
+        ui_passwordfield(dialog, .varname = "password", .onactivate = action_dialog_onactivate);
     }
     
     ui_show(dialog);

mercurial