Tk eventloop

S

swell

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(MyComponent.IEvents):
def OnUpdate(self, ItemName, UserTag):
global w
v = ptrAx.getV(ItemName)
print "%s" % v
w.configure(text='a')

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

ptrAx = win32com.client.DispatchWithEvents(r'MyComponent',Event1)
ptrAx.StartUpdates()

root.mainloop()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top