Re: libglade custom properties



Paolo Molaro wrote:

On 11/23/01 James Henstridge wrote:

typedef void (* GladeApplyCustomPropFunc)(GladeXML *xml,
                                        GtkWidget *widget,
                                        const gchar *propname,
                                        const gchar *value);

void glade_register_custom_prop(GType type,
                              const gchar *prop_name,
                              GladeApplyCustomPropFunc apply_prop);

[...]

Note that this API addition is a "semi public" API -- a normal app wouldn't use it, but a library implementing libglade support may need it.


What if a library of widgets written in some language binding
needs to have custom property support as well?
You need the usual user_data/destroy_notify pair in the API.

Assuming all widgets were fully customisable through the normal properties interface, then this API shouldn't be needed... Note that the other APIs for registering widget build and child adding routines also have this defficiency, so I don't know how useful it would be to fix this one problem though.

Note that if your custom widget, written in some language binding, supports the standard properties interfaces (widget properties and if it is a container, child packing properties), then no special libglade support will be necessary at all.

Does this sound like it would be enough for your perl bindings? (I think it should be enough for the python bindings).

Note also that these handlers would never be freed, so a destroy notify wouldn't be used even if I added it as an argument.

James.

--
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






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