summaryrefslogtreecommitdiff
path: root/gtk/gtkoptionmenu.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-02-17 22:12:25 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-02-17 22:12:25 +0000
commitab1deac87fa395332b73daf8e2e4c893e23be3e4 (patch)
tree6ecac4c8b00d557df9d0a0a4ee8a9f9c0a80e7dc /gtk/gtkoptionmenu.c
parentd0f73034cf5e6c5b7f52ce7d31bd3b3d8cca0d4c (diff)
downloadgtk+-ab1deac87fa395332b73daf8e2e4c893e23be3e4.tar.gz
Add patch from Jonathan Blandford and Anders Carlsson to change the Paned
Thu Feb 17 17:10:12 2000 Owen Taylor <otaylor@redhat.com> * gtk/gt{h,k,}vpaned.[ch]: Add patch from Jonathan Blandford and Anders Carlsson to change the Paned widgets so that they can be dragged from anywhere along the length. Also change the way that this is drawn to make this apparent. * gtk/gtkoptionmenu.c (gtk_option_menu_get_history): Apply patch from George Lebl to check that option_menu->menu is present before getting history.
Diffstat (limited to 'gtk/gtkoptionmenu.c')
-rw-r--r--gtk/gtkoptionmenu.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index c4d4009e07..c3ea92ada6 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -250,12 +250,17 @@ gtk_option_menu_get_history (GtkOptionMenu *option_menu)
GtkWidget *active_widget;
g_return_val_if_fail (GTK_IS_OPTION_MENU (option_menu), -1);
-
- active_widget = gtk_menu_get_active (GTK_MENU (option_menu->menu));
- if (active_widget)
- return g_list_index (GTK_MENU_SHELL (option_menu->menu)->children,
+ if (option_menu->menu)
+ {
+ active_widget = gtk_menu_get_active (GTK_MENU (option_menu->menu));
+
+ if (active_widget)
+ return g_list_index (GTK_MENU_SHELL (option_menu->menu)->children,
active_widget);
+ else
+ return -1;
+ }
else
return -1;
}