Re: Parsing custom-typed properties from Glade file



Is Type a custom enum? I have never tried to use such an enum in a glade file, but I looked at what gtk does.

Their enums are registered with g_enum_register_static(). Each enum value is specified with a GEnumValue, which contains a nickname. The nickname is used in glade files. Example:
                <property name="direction">none</property>

On 2020-07-22 07:00, Rodolfo Ribeiro Gomes via gtkmm-list wrote:
Hello, everyone.

I created a custom widget that has a Glib::Property of an enum type.
Glib::Property<Type> property_type_;

When I try to load from a glade file, I got this error message:

Gtk-WARNING **: 01:43:34.849: Failed to set property gtkmm__CustomObject_widget_color_slider.type to 1: Could not parse '1' as a glibmm__CustomBoxed_N6studio11ColorSlider4TypeE

Here is the xml property line:
            <property name="type">1</property>

How can I properly parse the property tag contents ?




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