Re: BonoboControl-based class



Hi Rodrigo,

On 5 Dec 2001, Rodrigo Moya wrote:
> BonoboControl
> --> GnomeDbControl
>   --> GnomeDbShellComponent
>
> GnomeDbShellComponent, in turn, implements a CORBA interface
> (GNOME::Database::UIShellComponent), so, to create the get_type
> function for this class, I use:

        Um - I think you're confused.

        You shouldn't be inheriting your UIShellComponent interface from
BonoboControl, you should implement your interface separately and call it
something more specific and descriptive, and aggregate it to an instance
of GnomeDBControl.

> BONOBO_X_TYPE_FUNC_FULL (GnomeDbShellComponent,
>                          GNOME_Database_UIShellComponent,
>                          PARENT_TYPE,
>                          gnome_db_shell_component)
>
> everything compiles ok, etc, and when I try to load my component (a
> GnomeDbShellComponent) in test-moniker:

        Unless GNOME_Database_UIShellComponent inherits from
Bonobo_Control this is never going to work, and it shouldn't inherit from
it so ... :-)

        Use aggregation and queryInterface - they really are your friends.

> it seems to me that the Bonobo/Control interface does not get
> aggregated to my GnomeDbShellComponent? The component is correctly
> created on the server side, but it seems that interface is not
> recognized by the client.

        The TYPE_FUNC stuff is for doing inheritance not aggregation, see
bonobo_object_add_interface.

        Regards,

                Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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