Re: [gtk-list] Re: Modal dialog with two gtk_main() [Last try..]



On Wed, 8 Sep 1999, Havoc Pennington wrote:

> 
> On Wed, 8 Sep 1999, Sven Anders wrote:
> > What's wrong with the attached program? It's a much simpler version
> > of my problem, but why does it not work?
> > 
> 
> The problem is that you're using the "pressed" signal instead of
> "clicked"; use "clicked" for this purpose.
> 
> "pressed" is emitted when the button is pressed in, "released" is emitted
> when the button pops out, and "clicked" is emitted after the
> pressed+released combination. The problem you're seeing is that 
> the button calls gtk_grab_add() when pressed, and gtk_grab_remove() when
> released; when you set a dialog modal, it also calls gtk_grab_add(), so
> then the button's gtk_grab_remove() removes the wrong grab and makes a big
> mess.
> 
> Anyway, this is a GTK bug but you should really be using "clicked" anyway,

havoc, could you elaborate on this "gtk bug" here? grab_remove takes
a widget argument, and gtk grabs in general support stacking, so what's
the bug here? (anyways, you are right that things won't work untill he
connects to the "clicked" signal, but that doesn't mean the gtk grab stack
is buggy).

> so the workaround isn't painful. Thanks for the nice code example, I was
> able to compile it and identify the problem very quickly. Everyone should
> do this when asking questions. :-)
> 
> Havoc
> 

---
ciaoTJ



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