Re: Pluggable widgets II

On Wed, 20 Dec 2006, Mark McLoughlin wrote:

On Wed, 2006-12-20 at 10:22 +0100, Tim Janik wrote:
On Wed, 20 Dec 2006, Mark McLoughlin wrote:

 - How does this work for application derived types?

   e.g. if vino derives from GtkLabel to make a label which looks like
   a clickable URL, then even if it is instantiated using
   g_factory_create() a gtk theme module will not be able to replace
   it given the fact it does not have access to the derived gtype

a theme has many other means to affect widget look or behavior.
it is not meant to appoint new widget types. or - if you have a
use case for this, please elaborate.

	Where is intended for new implementations of stock widgets and dialogs
to be plugged in? A gtk+ module? Or a "platform library" which apps must
link to in order to use these new implementations?

both would be possible.

	Whichever it is, I'm wondering about things like VinoUrl - i.e. an
application derived widget. Should it be expected that a plugged-in
re-implementation of GtkLabel would also be used by VinoUrl? Probably
not, now that I think of it.

i really don't know anything about VinoURL.
however, if you need exactly a GtkLabel for it, you'll call g_object_new (GTK_TYPE_LABEL, NULL). but if you mean to look/behave
like the rest of the labels on a platform and just need a widget that
implements the GtkLabel API, you'll call g_factory_create (GTK_TYPE_LABEL)
(or gtk_label_new()) and may e.g. get a FoovendorLabelWithFunkyColors that
is derived from GtkLabel.



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