Re: Can't add new GTK 2.16 methods to GtkStyle



Would the code in tie_properties() be giving full names? ÂThe unhappy
surprise for a generic bit like tie_properties() would be that
get_property / set_property don't match what list_properties,
find_property and the notify:prop signal name stuff say.

Because there's no properties on GtkStyle I suppose not too much can go
wrong. ÂBut in the worst case you could imagine a different get_property
may even be incompatible for an object inspector, if someone has been
walking all objects with Devel::FindBlessedRefs or the like and hoping
the names from list_properties can be accessed with get_property.

These are good points. ÂThere might be a lot of code out there relying on
get_property() being Glib::Object::get_property(). ÂI still think that's
broken, since there's no guarantee that subclasses avoid naming methods
"get_property". ÂBut maybe we should declare this a case of "don't do
that!".

So, if we want to install such a "social rule", we have to adhere to it in
Gtk2::Style too. ÂAs I see it, there are two ways to do that:

â Make Gtk2::Style::get() call gtk_style_get(), but leave get_property()
alone. ÂThis has a precedent in Gtk2::TreeModel. ÂBut unlike in the
Gtk2::TreeModel case, the C API also provides gtk_style_get_property(), and
people seeing that might expect that calling get_property() on a Gtk2::Style
invokes it.

â Use different names for the wrappers, e.g.
Gtk2::Style::get_style_property() for gtk_style_get_property(). ÂThis has
the disadvantage of deviating from the usual mapping from C function names
to Perl method names. ÂAnd what would we call the gtk_style_get() wrapper?
ÂOr would we only provide get_style_property()?

Should we do one of the above, or leave things as they are now? ÂWhat do you
all think?

If it's of any help, from the Gtk+ 3.0 Theming API hackfest Minutes
(http://www.mail-archive.com/gtk-devel-list gnome org/msg09577.html)
it looks like GtkStyle will get deprecated soon.

Nevertheless, the questions raised by Torsten are still valid. This
situation could happen again. We should probably consult this with the
developers of the other GTK bindings as they might be in a similar
situation.

--
Emmanuel Rodriguez



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