Re: custom property setter not fired on commit
Tristan Van Berkom <[email protected]> Sat, 15 Mar 2014 14:10:40 +0900
| Newsgroups | gmane.comp.gnome.glade.user |
|---|---|
| Message-ID | <CAGUy9WJfaH=0W0Uma-6_eVpBmz1RK3yqkOfV8PXD9zrJVw6GOw@mail.gmail.com> |
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 <[email protected]> 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 - [email protected]
> http://lists.ximian.com/mailman/listinfo/glade-users
_______________________________________________
Glade-users maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/glade-users