Package: xchat-gnome Version: 1:0.30.0~git20100421.29cc76-1 Followup-For: Bug #627711
I've been trying to fix this for myself, the derived ConnectDialog class appears to partially use the glade UI file, not the whole. Only the GtkScrolledWindow and GtkTreeView are referenced, not even the action buttons at the bottom. Instead, the buttons are explicitly created by the init function itself. This is broken somehow, and the bug still happens even in upstream git master. Looks like it's under unfinished development. My workaround is not to use the glade file at all. Just call GTK+ functions directy to construct the widgets, as in the attached patch. (Note that this has yet to be done to other Glade-based UIs in the program as well.) I know this may not be what upstream wants to adopt, as they obviously want to use GtkBuilder over the derived GObject class. Just wish it helps somehow to push this bug further. Another choice is to downgrade to latest stable release? Regards, -- Theppitak Karoonboonyanan http://linux.thai.net/~thep/
Index: xchat-gnome-0.30.0~git20100421.29cc76/src/fe-gnome/connect-dialog.c =================================================================== --- xchat-gnome-0.30.0~git20100421.29cc76.orig/src/fe-gnome/connect-dialog.c 2011-07-28 15:50:38.659477045 +0700 +++ xchat-gnome-0.30.0~git20100421.29cc76/src/fe-gnome/connect-dialog.c 2011-07-30 00:03:42.851410611 +0700 @@ -132,20 +132,15 @@ static void connect_dialog_init (ConnectDialog *dialog) { - gchar *path = locate_data_file ("connect-dialog.glade"); - g_assert(path != NULL); + dialog->toplevel = gtk_scrolled_window_new (NULL, NULL); + gtk_container_set_border_width (GTK_CONTAINER (dialog->toplevel), 5); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dialog->toplevel), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox), + dialog->toplevel, TRUE, TRUE, 0); + gtk_widget_show (dialog->toplevel); - GtkBuilder *xml = gtk_builder_new (); - g_assert (gtk_builder_add_from_file ( xml, path, NULL) != 0); - - g_free (path); - -#define GW(name) ((dialog->name) = GTK_WIDGET (gtk_builder_get_object (xml, #name))) - GW(toplevel); - GW(server_list); -#undef GW - - g_object_unref (xml); + dialog->server_list = gtk_tree_view_new (); dialog->server_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->server_list), GTK_TREE_MODEL (dialog->server_store)); @@ -154,6 +149,10 @@ GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes ("name", renderer, "text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->server_list), column); + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (dialog->toplevel), + dialog->server_list); + gtk_widget_show (dialog->server_list); + GtkWidget *button = gtk_button_new_with_mnemonic (_("C_onnect")); gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);