Re: Convenience functions



Owen Taylor <otaylor redhat com> writes:

> Jonathan Blandford <jrb redhat com> writes:
> 
> > Owen Taylor <otaylor redhat com> writes:
> > 
> > > Here's an implementation of the convenience handlers we discussed.
> > > (#56859). While implementing them, I became uncertain whether
> > > most of these changes make sense:
> > > 
> > >  * gtk_handler_make_widget_[in]sensitive() are just going to
> > >    be very rare functions to use. You use them a total of 3
> > >    times in Beast, in doing fairly exotic things.
> > 
> > I do this all the time as a callback in my pyglade applications --
> > mostly in response to a row_selected/unselected event.  Perhaps a more
> > powerful glade could handle this, but it might be nice.
> 
> Could you provide a code fragment demonstrating how you would use
> these convenience handlres in this type of use? I'm not sure I quite
> get the idea.

[ Perhaps I should actually look at the convenience function rather then
  assuming they do what it sounds like.  I could be horribly wrong about
  the intent of these functions.  They probably need renaming if I am. ]

The idea was to tie the sensitivity of a widget to a clists selection,
in this instance.  An example would to be to do something like:

g_object_connect_swapped (G_OBJECT (clist),
                          "row_selected",
                          gtk_handler_make_widget_sensitive,
                          next_button);

or

g_object_connect_swapped (G_OBJECT (clist),
                          "row_unselected",
                          gtk_handler_make_widget_insensitive,
                          next_button);

when the clist was in GTK_SELECTION_BROWSE mode.  In retrospect, this
would be more useful if things like GtkTreeView and GtkToggleButton had
a way of getting state in a signal form.

Thanks,
-Jonathan




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