[gtk+] menu: Modernize code



commit 6c7b6f9654c1e95460a732aeb9e2ac763a21c6ff
Author: Benjamin Otte <otte redhat com>
Date:   Mon Oct 10 16:52:50 2016 +0200

    menu: Modernize code
    
    No functional changes, just don't call valist functions anymore.

 gtk/gtkmenu.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 1921dd4..2b4b1d1 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1186,13 +1186,10 @@ gtk_menu_init (GtkMenu *menu)
 
   menu->priv = priv;
 
-  priv->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
-                                                   "type", GTK_WINDOW_POPUP,
-                                                   "child", menu,
-                                                   NULL),
-                                     "signal::event", gtk_menu_window_event, menu,
-                                     "signal::destroy", gtk_widget_destroyed, &priv->toplevel,
-                                     NULL);
+  priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP);
+  gtk_container_add (GTK_CONTAINER (priv->toplevel), GTK_WIDGET (menu));
+  g_signal_connect (priv->toplevel, "event", G_CALLBACK (gtk_menu_window_event), menu);
+  g_signal_connect (priv->toplevel, "destroy", G_CALLBACK (gtk_widget_destroyed), &priv->toplevel);
   gtk_window_set_resizable (GTK_WINDOW (priv->toplevel), FALSE);
   gtk_window_set_mnemonic_modifier (GTK_WINDOW (priv->toplevel), 0);
 


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