[Glade-users] custom property setter not fired on commit

Tristan Van Berkom tristan.van.berkom at gmail.com
Sat Mar 15 05:10:40 UTC 2014


If your custom property is of some unknown GType, like a boxed type
you introduced for example, you will need to provide a
GladeStringFromValue function[0] in your widget adaptor definition.

The string it generates must be unique per possible value that your
GType can have, without this Glade has no way to compare your value
with another value and cannot tell if the value actually changed or
not (and thus needs to be updated in the workspace).

As with all other GladeWidgetAdaptor methods, the string_from_value()
method should chain up to the adaptor implementing the parent widget
type if that is appropriate, here is an example of how we handle it
for the custom "items" property of GtkComboBoxText[1], GtkListStore[2]
also does this for the "columns" property.

Cheers,
    -Tristan

[0]:https://developer.gnome.org/gladeui/unstable/gladeui-glade-widget-adaptor.html#GladeStringFromValueFunc
[1]:https://git.gnome.org/browse/glade/tree/plugins/gtk+/glade-gtk-combo-box-text.c#n82
[2]:https://git.gnome.org/browse/glade/tree/plugins/gtk+/glade-gtk-list-store.c#n243


On Fri, Mar 14, 2014 at 11:12 PM, Domenico Ferrari <domfe at tiscali.it> wrote:
> Hi.
> I'm doing a new plugin for my widget...
> It has a property editable with a TreeView, like "columns" on
> GtkListStore object.
> In my callback function on "edited" signal I have the following code
>
>   g_value_init (&value, MY_TYPE_COLUMN_FORMAT_LIST);
>   g_value_take_boxed (&value, colfmt);
>   glade_editor_property_commit (eprop, &value);
>
> but my custom property setter is not fired. If I use
> glade_property_set it is correctly called but I miss the undo/redo
> stack.
> Can I have some help?
>
> Thanks!
> _______________________________________________
> Glade-users maillist  -  Glade-users at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users


More information about the Glade-users mailing list