Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tk eventloop

Reply
Thread Tools

Tk eventloop

 
 
swell@netcourrier.com
Guest
Posts: n/a
 
      09-21-2006
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()

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] EventLoop 0.0.20050825.1600 Daniel Brockman Ruby 31 09-08-2005 06:29 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57