[Gtk-sharp-list] GLib property change notification?

Bojan Rajkovic severedcross at gmail.com
Sat Jul 24 08:12:35 EDT 2010

On Sat, Jul 24, 2010 at 3:07 AM, Zach Bean <zb at forty2.com> wrote:

> Hi all,
> Pardon my ignorance, but is there any way in Gtk# to get notified when an
> one of an object's GLib properties gets changed?  In other languages, I'd
> connect to GObject's notify::<property> signal, but there doesn't seem to
> be
> a corresponding event exposed in Gtk#.
> Specifically, I want to be notified when any one of 3 Gtk.Expanders (packed
> in a Gtk.VBox) gets opened or closed.  The point of the exercise is to try
> to make expanders take up as little space as possible when they're in the
> "not expanded" state, but allow them to take as much space as possible when
> they're "expanded".
> My plan was to listen for the "expanded" property to change, then use
> vbox.SetChildPacking() to change the "expand" flag accordingly.  There may
> well be a better (or just different) way of doing this, but neither my
> tired
> brain nor Google seem to have turned up much.
> Much appreciated,
> Zach Bean

Hi Zach,

You can listen to the Activated property on Gtk.Expander and then check the
Expanded property to figure out if it's open or closed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20100724/695e0953/attachment-0001.html 

More information about the Gtk-sharp-list mailing list