Hi Phil,

Maybe you can do something I do a lot. I create a wrapper for the object I inserted in my gladefile (like a treeview) for example. And I use the __getattr__ to call into the wrapped object.

For example

class TreeViewWrapper:
  def __init__(self,wrappedobj):
    self._obj = wrappedobj
  def __getattr__(self,attr):
    return getattr(wrappedobj,attr)
  def a_new_method(self,a):
    pass

treeview = TreeViewWrapper(mygladetree.get_widget("tv"))
treeview.a_new_method()

Regards,

Guillaume

[EMAIL PROTECTED] wrote:
Hi list,

I want to design my gui using glade and then inherit some classes from widget of the gui. As i can only get the instance of widgets using gtk.glade.XML.get_widget(name), how can i inherit some classes from the instance?

Thanks a lot for your answer.
Philippe Collet

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to