Where to put your big widgets ...




Hello all,

On 30 Mar 2000, Maciej Stachowiak wrote:
> To be honest, we only discussed it very briefly; we all agreed we need
> some sort of widget repository for a number of reasons, and listed a

	It seems to me that there is no problem with small, neat widgets
going into Gtk, so we are then just left with the big ambling badly
written widgets; it seems to me that these are ripe for becoming Bonobo
controls.

> * Use Bonobo components.

	I couldn't have said it better myself =)

> I am sure there are many other possibilities.

	Arn't there always.

> use our component model for certain purposes. Do you really think it
> makes sense to say that the only way apps can share a widget that is
> not in Gtk+ or gnome-libs is to make it a Bonobo component?

	Probably yes.

> * Bonobo is fairly heavyweight; this would add a lot of memory and
>   runtime overhead to each widget.

	Hmm, I would have thought this however I can't say I noticed it
with the glade work I did. What I do notice is ( as you perspicuously
point out ) the runtime overhead.

	Runtime overhead is appalling for gnome applications, this is
particularly noticable when you have a small component of a few hundred
lines taking ages to start up to the point where it registers its factory.
I think using bonobo would focus a few minds on cleaning up GNOME's dire
startup latency. The only real way to fix this is to profile, but it seems
shared library profiling is a black art. Is there anyone that has profiled
a GNOME app's startup recently ?

> * Taking a usable widget and making it into a usable Bonobo component
>   is a lot of work. You need to implement a CORBA server and you need
>   to implement some new IDL interfaces specific to the methods and
>   signals your custom widget supports. If people had to do all this
>   work to be able to share their widget, they simply wouldn't
>   bother. They would cut and paste or find some other solutions.

	Not true; admittedly it was rather ugly until recently for various
reasons, however creating a new control ( equivilant to a widget ) is this
simple:

	BonoboControl *control;

	calc = gnome_calculator_new ();
	gtk_widget_show (calc);

 	/* Create the control. */
	control = bonobo_control_new (calc);

	From bonobo/samples/controls/bonobo-calculator-control.c

	Using it is comparitively simple too:

	control = bonobo_widget_new_control ("control:calculator", NULL);

	So; ok, bonobo signals will need writing but this is the work of a
few hours in bonobo.

	In summary:

	a) Bonobo is not per-se slow; GNOME startup is
	b) Bonobo Controls equate to Gtk Widgets and are easy to use
	c) It's not finished yet but it's a few man days away.

	I hope this sheds some light somewhere ?

	Regards,

		Michael.

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



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