[Gtk-sharp-list] Glade

Doug Pomerenke djp@visi.com
23 Feb 2004 11:29:04 -0600

On Mon, 2004-02-23 at 10:55, tapia wrote:
> El dom, 22-02-2004 a las 18:30, Miguel de Icaza escribió:
> > Hello,
> > 
> > > Is it possible to make custom widgets with Glade, then add them to a
> > > container at run time. Something like the User Controls that are a
> > > feature of C# with MS Visual Studio. The reason I ask is that I want to
> > > put all the GUI components for a discrete business operation, (use
> > > case), in the custom widget. All events are handled in a corresponding
> > 
> > Yes, it is possible.
> > 
> > Monodoc and mPhoto do this: they just leave empty spots where they can
> > "add" widgets later on.
> > 
> > Just track the name of the container, and then do the Add from the
> > source code.
> I think he asks for the opposite: create the container programatically,
> and insert the widget created in Glade.
> It should be useful for me too, if it would be possible :-)
> C.
I would like to use Glade to design a custom component consisting of a
container and labels, text boxes, buttons, list, etc. The custom
component would be a class in itself. (As far as I can tell, Glade
cannot do this.) There would be a corresponding class that handles all
the events from all widgets in the custom component. The application
would start with a main window that has three GtkVBoxes, The middle box
would be empty. Then these custom components that are part of this
window will be created along with each one's corresponding event
handler. The event handlers need to be hooked into the component much
like the Autoconnect method of the Glade.XML class. Then these custom
components are added to the GtkVBox in the main window. The main window
will then have no code for handling events from widgets on the custom
components. This will make it easier to add and remove functionality to
and from the application. Every window that is displayed would be done
this way.