Re: [gtk-list] Re: Cosmetic problem with GTK_STATE_PRELIGHT




Guillaume Laurent <glaurent@worldnet.fr> writes:

> Stefan Jeske <jeske@braunschweig.netsurf.de> writes:
> 
> > I discovered the following problem : I'd like to set a button
> > insensitive after pressing it. (Every time the button is pressed, a
> > list item is deleted. List empty => button should be disabled)
> 
> Just a guess here, but are you connecting the "pressed" event, or the
> "clicked" event ? I had a somewhat similar problem recently because I
> had connected the "pressed" event to a function that would do some
> rather drastic changes to the button so that it would never get the
> "released" event and stay in an awkward state.

I don't think this is the problem here. The button isn't staying
in the pressed state, it is staying in the PRELIGHT state - which
happens because once it is insensitive, it will never get the
"leave" event that tells it to return to the normal state.

A workaround would be to do:

  gtk_widget_set_state (button, GTK_STATE_NORMAL);
  gtk_widget_set_sensitive (button, FALSE);

The real fix needs to be in GTK, but I haven't figured out what
needs to be done yet.

Regards,
                                        Owen



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