[libnma/lr/gtk-4.0: 25/33] tests/mobile-wizard: make it work with Gtk4




commit 2cae60f096ac034602804fa5fc9db49d9035d5b7
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Thu Oct 7 12:11:21 2021 +0200

    tests/mobile-wizard: make it work with Gtk4
    
    gtk_main() and gtk_main_quit() are gone. Replace them with GMainLoop
    instead.

 src/tests/mobile-wizard.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/tests/mobile-wizard.c b/src/tests/mobile-wizard.c
index 24d9aee9..5c00616d 100644
--- a/src/tests/mobile-wizard.c
+++ b/src/tests/mobile-wizard.c
@@ -12,19 +12,24 @@
 static void
 wizard_cb (NMAMobileWizard *self, gboolean canceled, NMAMobileWizardAccessMethod *method, gpointer user_data)
 {
-       gtk_main_quit ();
+       GMainLoop *loop = user_data;
+
+       g_main_loop_quit (loop);
 }
 
 int
 main (int argc, char *argv[])
 {
+       GMainLoop *loop;
        NMAMobileWizard *wizard;
 
        gtk_init ();
+       loop = g_main_loop_new (NULL, FALSE);
 
-       wizard = nma_mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_NONE, TRUE, wizard_cb, NULL);
+       wizard = nma_mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_NONE, TRUE, wizard_cb, loop);
 
        nma_mobile_wizard_present (wizard);
-       gtk_main ();
+       g_main_loop_run (loop);
        nma_mobile_wizard_destroy (wizard);
+       g_main_loop_unref (loop);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]