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




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,
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




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