]> git.tdb.fi Git - ext/subsurface.git/blobdiff - gtk-gui.c
Linus would like to be less on the bleeding edge of Gtk+
[ext/subsurface.git] / gtk-gui.c
index 985a70e04e0f29a7456a83c7caeea6311215b58d..140129f607b26a3fb53f86624773ec66e5bb4a09 100644 (file)
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -460,8 +460,8 @@ static void switch_page(GtkNotebook *notebook, gint arg1, gpointer user_data)
        repaint_dive();
 }
 
-static const char notebook_name[] = "123";
-
+static const char notebook_group[] = "123";
+#define GRP_ID ((void *)notebook_group)
 typedef struct {
        char *name;
        GtkWidget *widget;
@@ -500,8 +500,8 @@ static GtkNotebook *create_new_notebook_window(GtkNotebook *source,
        gtk_container_add(GTK_CONTAINER(win), vbox);
 
        notebook = gtk_notebook_new();
+       gtk_notebook_set_group(GTK_NOTEBOOK(notebook), GRP_ID);
        gtk_widget_set_name(notebook, nbdp->name);
-       gtk_notebook_set_group_name(GTK_NOTEBOOK(notebook), notebook_name);
        gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 6);
        gtk_widget_set_size_request(notebook, 450, 350);
 
@@ -524,9 +524,9 @@ static void drag_cb(GtkWidget *widget, GdkDragContext *context,
         * this all to figure out which window we're talking about.
         */
        source = gtk_drag_get_source_widget(context);
-       if (! strcmp(nbd[0].name,gtk_widget_get_name(source)))
+       if (nbd[0].name && ! strcmp(nbd[0].name,gtk_widget_get_name(source)))
                nbdp = nbd;
-       else if (! strcmp(nbd[1].name,gtk_widget_get_name(source)))
+       else if (nbd[1].name && ! strcmp(nbd[1].name,gtk_widget_get_name(source)))
                nbdp = nbd + 1;
        else
                /* HU? */
@@ -598,10 +598,10 @@ void init_ui(int argc, char **argv)
        /* Notebook for dive info vs profile vs .. */
        notebook = gtk_notebook_new();
        gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 6);
-       gtk_notebook_set_group_name(GTK_NOTEBOOK(notebook), notebook_name);
+       gtk_notebook_set_group(GTK_NOTEBOOK(notebook), GRP_ID);
        g_signal_connect(notebook, "create-window", G_CALLBACK(create_new_notebook_window), NULL);
        gtk_drag_dest_set(notebook, GTK_DEST_DEFAULT_ALL, &notebook_target, 1, GDK_ACTION_MOVE);
-       g_signal_connect(notebook, "drag-data-received", G_CALLBACK(drag_cb), notebook);
+       g_signal_connect(notebook, "drag-drop", G_CALLBACK(drag_cb), notebook);
        g_signal_connect(notebook, "switch-page", G_CALLBACK(switch_page), NULL);
 
        /* Create the actual divelist */