[Glade-users] Partial interfaces - no top level?



You can build from a specific widget in the "glade.XML" method.
For example (using python, but it should be similar for ruby):
frame_tree = gtk.glade.XML('somewidget.glade', 'someframe')
frame = frame_tree.get_widget('someframe')
yourgui.add(frame)

Put your widget inside a 'window' toplevel (or any other toplevel).
This has the advantage that if you ever want to display your widget
seperately, you can just do:
window_tree = gtk.glade.XML('somewidget.glade')
without the second argument.

I hope this helps!


On Tue, Apr 7, 2009 at 2:02 PM, Matt Savigear <mcs_glade at savigear.com>wrote:

Hi list,

Sorry if this is an elementary question, but thus far I haven't managed
to find anything via Google: Is it possible to define a partial
interface in glade? In other words, one which does not have a top level
object.

I'd like to build an application which dynamically loads chunks of
functionality which may be unknown at design time (i.e. plug-ins). I'd
like to be able to pass the plug-in a reference to a container widget
(supplied by the main application UI, maybe a notebook page) and
effectively have it assign its own partial user interface this widget as
a container.

It looks like the only way to achieve this is for the plug-ins to define
their UI programatically. I can't just seem to create, say, a frame as
the highest-level widget and build my UI in this. Of course, I may also
be thinking/going about this in completely the wrong way.

If it makes any difference, I will be using ruby for the development.

Thanks for any pointers.

--
Cheers,

Matt.

"All placebos are not the same - Pacifex is the only placebo that's
green and shaped like a triangle. Pacifex: A doctor gave it to you."

_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20090407/ea77b0fe/attachment.html 




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