Re: How to wire a GnomeCanvas into glade-based GUI?



Christian Convey wrote:
In my Python code I define a subclass of GnomeCanvas.

I want to build most of my gui using glade and instantiate its objects using
gtk.glade.XML('myfile.glade')

Can anyone tell me...
(1) what object, if any, I should in my Glade design as a place holder for
the GnomeCanvas-subclass I'll be placing there at runtime?
and
(2) at runtime, how I add my GnomeCanvas-subclass instance to the
window/widget hierarchy?


Hello Christian,
    I'm not very familliar with bindings... but what I suppose you want
to do is use a python binding to glade_xml_register_widget() in order to
tell libglade about your custom GType (on the runtime side of things)...
if this is not possible then you can use the old style "Custom widget"
method that will allow you to have a function called to build your
widget... again I dont know what that spells in binding land.

In the editor side of things... I've got docs [1] on how to do that
in C (integrate your widget into glade-3)... so if you've got any C
bindings to your python code you could use that ;-p (that must have
been a joke... but seriously... may I have such a binding ?)

otherwise... your stuck again using the old "Custom widget" hack.

Cheers,
                         -Tristan

[1] http://gnome.org/~tvb/glade_api/




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