Re: GObject



Ron Steinke <rsteinke w-link net> writes:
> 	Could someone explain how the "properties-changed" signal in
> GObject is supposed to work? How do you write objects so they use
> it properly?
> 

You don't use it - we are campaigning to get it removed because it
slows down GTK a lot and is not particularly useful.

To get notification you connect to "notify::property_name", or just 
"notify" to get notification on all properties.

To see how to send notifies in your own object implementations, look
at most any GTK widget. Typically:

void
set_foo (Object *obj, Foo *foo)
{
 obj->foo = foo;
 g_object_notify (obj, "foo");
}

obj_set_property (blah blah)
{
 case PROP_FOO:
   set_foo (obj, g_value_get_foo (value));
 break;
}

Havoc




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