Re: Multiple bonobo widgets, advice required.



Hi Franco,

On Mon, 27 Nov 2000, Franco Broi wrote:
> I want to be able to have another drawable crontrolled from the same
> component appear in another scrolled window in my container app, this is
> what I've tried so far:
> 
> the component creates a drawable and uses it to create a control
> 
> control = bonobo_control_new(GTK_WIDGET(Drawable));
> 
> I convert the control to corba_objref and then to an IOR string
> 
> CORBA_char *ior = CORBA_ORB_object_to_string(orb,
> 	bonobo_object_corba_objref(BONOBO_OBJECT (control)), &ev);
> 
> I pass the IOR string to the container via a property set on my original
> drawable created via bonobo_widget_new_control. In the container I've tried
> doing the following

	This is a cunning hack around having to create a new IDL interface
it seems :-) Just a minor point; the properties are CORBA_any *'s at root,
and you should be able to pass a CORBA_any with an object in it; this
would be considerably simpler and quicker than stringifying and parsing
the IOR again.

> control = CORBA_ORB_string_to_object(orb, ior, &ev);
> wd = bonobo_widget_new_control_from_objref(control, uic);
> gtk_scrolled_window_add_with_viewport(GTK_WIDGET(sw), wd);
> 
> Although this runs without errors, the drawable in the container remains
> parentless and doesn't have get a window to draw on. I've tried using the
> same Bonobo_UIContainer used for the first drawable, and also creating a
> new one - the result is the same.

	Wierd; are you sure you are sending a different control object
reference ? it is certainly not possible for a single control to be inside
two ControlFrame's, if you try and do that you might get this problem.

> I need to have the scrolled windows controlled from the container
> application and therefore don't want to add the 2 drawables as a
> single multi-window widget.

	Hmm; it is always good to split your apps into lots of
components; however with scolling and controls, it is almost always best
to let the control manage the scrolling, and to insert any UI items needed
to control this into the container.

> Is what I'm trying to do valid or am I doing something wrong?

	Well it's not so pretty :-) but it should work AFAICS, is it
possible you forgot to do a 'show' on the widget before putting it in the
2nd control ? show_all will not propagate over an X plug / socket.

	Regards,

		Michael.

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





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