summaryrefslogtreecommitdiff
path: root/gtk/gtkoptionmenu.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2000-03-14 19:57:25 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-03-14 19:57:25 +0000
commit10ba4fd066042b4335ae45e7560565872f71ba9b (patch)
tree17f68ffb0d402b6e66bb891d4a7d9a02a9b6108b /gtk/gtkoptionmenu.c
parent3f98a849c70ae570b78095cef0152a33ec07c64e (diff)
downloadgtk+-10ba4fd066042b4335ae45e7560565872f71ba9b.tar.gz
Merges from gtk-1-2
Diffstat (limited to 'gtk/gtkoptionmenu.c')
-rw-r--r--gtk/gtkoptionmenu.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index c3ea92ada6..f5cff3bf4d 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -637,6 +637,7 @@ gtk_option_menu_position (GtkMenu *menu,
GtkOptionMenu *option_menu;
GtkWidget *active;
GtkWidget *child;
+ GtkRequisition requisition;
GList *children;
gint shift_menu;
gint screen_width;
@@ -651,8 +652,9 @@ gtk_option_menu_position (GtkMenu *menu,
option_menu = GTK_OPTION_MENU (user_data);
- width = GTK_WIDGET (menu)->allocation.width;
- height = GTK_WIDGET (menu)->allocation.height;
+ gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
+ width = requisition.width;
+ height = requisition.height;
active = gtk_menu_get_active (GTK_MENU (option_menu->menu));
children = GTK_MENU_SHELL (option_menu->menu)->children;
@@ -661,7 +663,10 @@ gtk_option_menu_position (GtkMenu *menu,
menu_ypos += GTK_WIDGET (option_menu)->allocation.height / 2 - 2;
if (active != NULL)
- menu_ypos -= active->requisition.height / 2;
+ {
+ gtk_widget_get_child_requisition (active, &requisition);
+ menu_ypos -= requisition.height / 2;
+ }
while (children)
{
@@ -671,7 +676,10 @@ gtk_option_menu_position (GtkMenu *menu,
break;
if (GTK_WIDGET_VISIBLE (child))
- menu_ypos -= child->allocation.height;
+ {
+ gtk_widget_get_child_requisition (child, &requisition);
+ menu_ypos -= requisition.height;
+ }
children = children->next;
}