Re: Once more a GtkComboBox preview :)



On 4 Nov 2000, Owen Taylor wrote:

> Kristian Rietveld <kristian planet nl> writes:
> 
> > Hi All,
> > 
> > Here's another snapshot of the new GtkComboBox. There are many many
> > changes, see the README in the tarball.
> > 
> > When I was working on it with my CVS glib/GTK+ of October 29, everything
> > worked fine. But I just updated my CVS glib/pango/GTK+ and now there are
> > problems with the signal handling:
> > 
> > GLib-Object-ERROR **: gsignal.c:928:g_signal_handler_block(): handler
> > block_count overflow, please report occourance circumstances to
> > gtk-devel-list gnome org
> > aborting...
> > Trace/breakpoint trap (core dumped)
> 

[snip]

> 
> If you want to work around this, a perhaps better way to handle
> this anyways is to keep track of the state of the toggle button
> yourself and then look at  
> 
>  GTK_TOGGLE_BUTTON (toggle_button)->active
> 
> in the ::toggled callback. When you change the toggle yourself,
> set your state member before calling gtk_toggle_button_set_active(),
> and then you'll know that there is nothing to do in the ::toggled
> callback.
> 

The ComboBox box only calls gtk_toggle_button_set_active () and doesn't
need to keep track of the state. So I removed the block/unblock handlers
because they aren't really needed. It works fine now...

> > In the lines 546 and 552 of gtkcombobox.c only one signal is being blocked
> > and unblocked. Another problem is the popup window of the GtkComboBoxGrid
> > which doesn't show up right anymore (see the test program).
> 
> Nothing to do with GTK+ changes, as far as I can see - the problem
> is that you are positioning the popup menu at the bottom of the
> widgets requisition, not at the bottom of the child widgets, and
> you are allocting a bunch of extraneous vertical space; here's
> a modified gtk_combo_box_size_request that should work better.
> (The basic problem was that you were adding the height
> of the arrow to the the height of the display widget to get
> the height of the requisition, instead of taking the max.
> 
> ====

[snip]

> 
> Though note that the positioning of the popup still needs to be
> adjusted for container->border_width.
> 

Thanks! The extraneous vertical space is gone now.

> > Because everything worked fine with my earlier CVS glib/GTK+, I _hope_
> > that all these crashed are caused by some bugs and not by my code...
> > That's why I decided to post this preview despite of the crashes...
> 

The real problem with the ComboBox is the tearoff window. When you click
on the tearoff menu item in the popup, a dialog window will be created. It
worked fine with my old CVS GTK+, but with my newer CVS GTK+ there are
problems with the dialog window. I searched for an example in case I was
coding stuff wrong, the only example which used a dialog window was the
DND example in testgtk, which was... commented out :) I only don't know if
the reason for commenting it out was the not working dialog window...

	Kris

-- 
"Running Windows on a Pentium is like having a brand new Porsche but only
be able to drive backwards with the handbrake on."
	(Unknown source - taken from fortune-mod-1.0-11)






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