Hello.

I am trying to make a plugin system for an app.  I am using libglade,
and have a container widget that will hold the plugged in modules.

I am useing the following function in the main prog to load and display
the modules, but am unsure about it.

def change_module(obj,node,column):  
    count = 0
    for child in Container.children():
        if count == 1:
                Container.remove(child)
        count = count +1
    try:
        CMod = obj.node_get_text(node,1)
        module = __import__(CMod)
        ModTree = GladeXML(CMod+".glade", CMod) 
        mod = ModTree.get_widget(CMod)
        Container.add(mod)
        module._setup()
    except Error, msg:
        print "some error?"


I would apreaciate any comments, and obviously any better ideas


-- 

  Rob Brown-Bayliss
 ---======o======---
  www.ZOOstation.cc
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to