A Qui, 2003-08-21 �s 07:09, Ben Liblit escreveu:
> James Henstridge wrote:
> > the Uploader object here is a Servant object, while the factory function
> > is required to return a bonobo.Object instance. It is currently not
> > possible to do this for custom interfaces in Python.
>
> :-(
>
> If that requirement is part of the bonobo GenericFactory interface, can
> I instead create my own UploaderFactory interface that is declared to
> return an Uploader object? If I do that, though, will I still be able
> to use bonobo's activation infrastructure? Or is the activation
> infrastructure fundamentally tied to GenericFactory and therefore to
> bonobo.Object?
bonobo-activation is *not* at all tied to GenericFactory. It is tied
to the Bonobo::GenericFactory IDL interface. See
$prefix/share/idl/bonobo-activation-2.0/Bonobo_GenericFactory.idl. See
also libbonobo source to see how it works. It seems that a generic
factory implementation should register itself first. See
bonobo-generic-factory.c:bonobo_generic_factory_construct():
ret = bonobo_activation_active_server_register (act_iid, BONOBO_OBJREF
(factory));
Later, the bonobo activation server will call the factory's
createObject() method. You should be able to implement a simple factory
in python this way.
>
> Taking a different approach, what are other examples of (non-custom)
> interfaces for which GenericFactory does work? I know about
> bonobo.Component, but I assumed that this provides widget embedding
> support which I do not need. Is there some other bonobo.Object subclass
> that would be a suitable superclass for my service? (Again, my service
> has a standalone PyGTK GUI in the form of a notification area icon, but
> is not intended for embedding within clients.)
Perhaps you could register a bonobo.PropertyBag object. This property
bag could have a property that would return your custom interface.
Regards.
--
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/