Matt Goodall wrote:
>
> It would be useful to create top-level panels using glade where a panel
> is a container with a number of widgets placed on it.
>
> If I called a panel, test_panel, whose top widget is a GtkVBox then the
> generated 'C' code would have a function, create_test_panel, which would
> build a GtkVBox widget, add the other widgets and return a pointer to
> the GtkVBox i.e.
>
> GtkWidget*
> create_test_panel()
> {
> GtkWidget *test_panel;
> // other widgets
>
> test_panel = gtk_vbox_new(...);
> // other code
>
> return test_panel;
> }
>
> This is really useful when many parts of an application use a common set
> of widgets. Obviously, the code I write would be responsible for
> creating one of these things and adding it to the correct container
> widget.
>
> Perhaps the glade UI could have a "panel" button in the palette. So for
> my above example I would create a panel and then add a GtkVBox to it
> followed by whatever other widgets I wanted.
>
> Taking this idea further, glade could actually have a panel pallette
> which lists the panels in the project. You could then use these panels
> in glade as if they were simple widgets with minimal properties and the
> source generators could actually produce the code which uses the panels.
>
> Please fell free to completely ignore this - glade will still be one of
> the better GUI designers around!
This kind of thing has been discussed before, and there was even a partial
implementation in Glade for a while. But it was never finished.
Where did you get your idea from? Another GUI builder/IDE?
The old Glade code did output a function like your create_test_panel() code
above. The problem then is that all the properties are fixed, so for example
if you have a label in your 'panel' you won't be able to change the name of it.
If you then try to support a few properties like the text for a particular
label, then I think the code will get a bit too complicated.
My favoured solution was just to support 'templates', which are like your
panels, but once you place them somewhere in the interface they act just
like normal widgets, and you don't have a separate creation function
(why is that important anyway?). So my 'templates' are just a quick way to
place a commonly used group of widgets in the interface.
Anyway, I think support for external widget libraries and Bonobo components
is a higher priority for now.
Damon
+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.