diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 6 | ||||
-rw-r--r-- | shell/e-shell-folder-creation-dialog.c | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 562c5a5b3b..1ce1944770 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2000-07-25 Ettore Perazzoli <ettore@helixcode.com> + + * e-shell-folder-creation-dialog.c (add_folder_types): Work around + GtkOptionMenu utter brokenness by destroying the associated + Glade-built GtkMenu and creating a new one from scratch. + 2000-07-24 Dan Winship <danw@helixcode.com> * e-shell.c, main.c: Remove GOAD support. diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c index 1fcfb779e3..e793b2ccff 100644 --- a/shell/e-shell-folder-creation-dialog.c +++ b/shell/e-shell-folder-creation-dialog.c @@ -292,9 +292,17 @@ add_folder_types (GtkWidget *dialog, folder_type_option_menu = glade_xml_get_widget (gui, "folder_type_option_menu"); + /* KLUDGE. So, GtkOptionMenu is badly broken. It calculates its size + in `gtk_option_menu_set_menu()' instead of using `size_request()' as + any sane widget would do. So, in order to avoid the "narrow + GtkOptionMenu" bug, we have to destroy the existing associated menu + and create a new one. Life sucks. */ + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (folder_type_option_menu)); g_assert (menu != NULL); - g_assert (GTK_IS_MENU (menu)); + gtk_widget_destroy (menu); + + menu = gtk_menu_new (); folder_type_registry = e_shell_get_folder_type_registry (shell); g_assert (folder_type_registry != NULL); @@ -316,8 +324,8 @@ add_folder_types (GtkWidget *dialog, type_name = (const char *) p->data; menu_item = gtk_menu_item_new_with_label (type_name); - gtk_menu_append (GTK_MENU (menu), menu_item); gtk_widget_show (menu_item); + gtk_menu_append (GTK_MENU (menu), menu_item); gtk_object_set_data (GTK_OBJECT (menu_item), "folder_type", (void *) type_name); @@ -325,7 +333,11 @@ add_folder_types (GtkWidget *dialog, default_item = i; } + gtk_option_menu_set_menu (GTK_OPTION_MENU (folder_type_option_menu), menu); + gtk_widget_show (menu); + gtk_option_menu_set_history (GTK_OPTION_MENU (folder_type_option_menu), default_item); + gtk_widget_queue_resize (folder_type_option_menu); return folder_types; } |