Re: Pluggable widgets II
- From: Tristan Van Berkom <tvb gnome org>
- To: Tim Janik <timj imendio com>
- Cc: Mark McLoughlin <markmc redhat com>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Pluggable widgets II
- Date: Wed, 20 Dec 2006 10:04:15 -0500
On Wed, 2006-12-20 at 15:34 +0100, Tim Janik wrote:
> > My point is that Foo would prefer if PanelMenu could automatically
> > sub-class FooGtkMenu rather than GtkMenu.
> with Gtk+ and its object system, that is simply not technically possible.
I've done some experimenting with subclassing of dynamic types
(or "types that may vary" for lack of better words).
In Glade, I use a GladeWidgetAdaptorClass to interface with the plugin,
the core proceeds to load C functions from the backend modules for each
supported class and then the core uses this to programaticly derive
the base adaptor class with dynamicly created subclasses -
it been working fine.
At first thought, assuming that:
g_type_is_a (g_factory_get_appointed (TYPE_FOO), TYPE_FOO);
(which Tim reassured me of in another email), then I believe
there should be no problems if the PanelMenuItem went ahead
and subclassed an appointed type directly - since that appointed
type must conform to the original type.
The remaining obvious problem however, is to ensure that the vendor did
in fact appoint its chosen type to the menu item *before* the
panelmenuitem goes ahead and registers its type.
] [Thread Prev