Re: GtkButton problem



In message <LAW2-F1272TRqf69aZb00012b30 hotmail com>you write:
>I wrote some days ago that I had problems with disabling a button in its own 
>signal handler. I have done some more testing and its seems like this is the 
>case. The following is the test program I used:
   [ ... ]
>When button1 is pressed it disables itself, when button2 is pressed it 
>enables button1, and when button3 is pressed it disables button1. When I 
>press button2 or button3 it works as expected, but when button1 is pressed 
>the interface frezes. The buttons are still exposed (i.e., if a move another 
>window over this window and then move it away the buttons are still 
>visible), but I can't press any of the buttons. Is this a bug?

my guess is that this pertains to X/GDK's handling of events. i
suspect that if you disable in the button_release_event rather than
the button_press_event, things will be fine. what i think is happening
is that there is an grab in effect on your button once the press
occurs and that by making the button insensitive at that time, the
release is never handled correctly, which would include the release of
the grab.

it should be pretty simple to try. i've run into several problems
trying to do certain things from a button_press_event, even though
that seemed like the logical place to do them.

--p




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