Re: [PATCH] fix GtkOptionMenu initial sizing



On Thu, 2001-12-13 at 13:50, jacob berkman wrote:
> On Wed, 2001-12-12 at 18:44, Owen Taylor wrote:
> > 
> > jacob berkman <jacob ximian com> writes:
> > 
> > > i have fixed the bug where GtkOptionMenu will initially be too big.
> > > 
> > > this screenshot shows the bug:
> > > 
> > > http://primates.ximian.com/~jacob/gnome2/optionmenu.png
> > > 
> > > the top one had an item selected in it; if you were to select an item in
> > > the bottom one it would snap to the correct size.
> > > 
> > > the patch is pretty obvious when you read it.
> > > 
> > > ok to commit, or is there a bug # i should attach it to?  i found a
> > > couple of gtkoptionmenu bugs but none seemed to be this one.
> > 
> > The fix looks correct, but maybe you could investigate a bit why it
> > it is necessary. In general, option_menu->height is supposed to be the
> > max of all the child items, so I wouldn't expect the MAX() to be needed
> > in the normal case.
> 
> ok, i've found out what's going on, and it explains why it sometimes
> works right, and lends another obvious potential fix.

sigh; this fix isn't totally correct yet either... though i am going to
not look into it further (for now at least).

the previous patch has still been correct in every case i've seen so
far.

> Index: gtkoptionmenu.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtkoptionmenu.c,v
> retrieving revision 1.58
> diff -u -r1.58 gtkoptionmenu.c
> --- gtkoptionmenu.c	2001/12/04 03:27:29	1.58
> +++ gtkoptionmenu.c	2001/12/13 18:47:27
> @@ -279,6 +279,13 @@
>        gtk_signal_connect_object (GTK_OBJECT (option_menu->menu), "size_request",
>  				 (GtkSignalFunc) gtk_option_menu_calc_size,
>  				 GTK_OBJECT (option_menu));
> +      gtk_signal_connect_object (GTK_OBJECT (option_menu->menu), "add",
> +				 G_CALLBACK (gtk_option_menu_calc_size),
> +				 GTK_OBJECT (option_menu));
> +      gtk_signal_connect_object (GTK_OBJECT (option_menu->menu), "remove",
> +				 G_CALLBACK (gtk_option_menu_calc_size),
> +				 GTK_OBJECT (option_menu));
> +      gtk_widget_size_request (menu, NULL);

(this size_request wasn't meant to be in the patch)

jacob
-- 
"In fact, can you imagine anything more terrifying than a zombie clown?"
	-- moby



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]