Re: Properties on interfaces



Fooling around with this a little more, two fairly obvious
issues came up:

 * What get_property/set_property methods get called? 
   Maybe the ones for the type for which add_interface() is called?
   But that doesn't allow overriding the implementation in
   derived classes, and also doesn't    

 * What to do about property IDs, since they are different
   for each class that has a given interface?

What I was thinking about to solve these problems is something
like:

 g_object_class_install_interface_property (file_chooser_dialog_class, 
                                            PROP_FILENAME,
                                            "filename",
                                            GTK_TYPE_FILE_CHOOSER);

Which says to forward PROP_FILENAME/filename to the "filename" property
of the GtkFileChooser interface.

This would be implemented by inserting a (hidden) "proxy" param-spec
into the paramspec pool.

This is perhaps somewhat related to:

 http://bugzilla.gnome.org/show_bug.cgi?id=51748

Where the problem is that to change the default value or implementation
of a property, you have to install an entirely new paramspec,
duplicating the doc strings.

Regards,
                                        Owen





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