Tk eventloop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • swell@netcourrier.com

    #1

    Tk eventloop

    Hi
    I try/struggle to use an ActiveX component in a Tk app. When i execute
    it i can catch the first event and then when i try to change the value
    of the w widget everything blocks and nothing is updated anymore.

    Does someone have an idea of what is wrong and how to smartly integrate
    these events with the Tk event loop.

    Thx
    Manu

    import win32com.client
    import pythoncom
    import MyComponent
    from Tkinter import *

    class Event1(MyCompon ent.IEvents):
    def OnUpdate(self, ItemName, UserTag):
    global w
    v = ptrAx.getV(Item Name)
    print "%s" % v
    w.configure(tex t='a')

    root = Tk()
    w = Label(root,text ="test")
    w.pack()

    ptrAx = win32com.client .DispatchWithEv ents(r'MyCompon ent',Event1)
    ptrAx.StartUpda tes()

    root.mainloop()

Working...