[Tutor] using lift()
Daryl G
gman_95@hotmail.com
Fri, 06 Jul 2001 21:26:12 -0000
Hi,
I'm trying to get my chatgui window to appear on top of other non-python
windows when it receives a message, For example, user has some other
applicatin displayed and is covering the python chatgui, I need it to appear
on top of whatever application the user is using when a message is received.
When I use self.rootobj.lift(), this doesn't happen. My mouse just turns
into an hour glass when I move it over the chatgui. I can't even click on
anything in it or type anything in there. I have to close the dos shell to
exit it.
#Threading class
class msgThread(threading.Thread):
def __init__(self, rb):
self.rootobj=rb
#app.recdata.set()
threading.Thread.__init__(self)
def run(self):
#st=self.rootobj.state()
while 1:
try:
data=app.tcpCliSock.recv(1024)
except:
pass
self.rootobj.lift() #should bring chat gui to top
app.recdata.set(data)
#Main code
root = Tk()
classtitle="chater"
root.title(classtitle)
app = App(root)
#Screen resolution must be set to 1024X768 or Gui will be off the screen if
#the resolution is smaller
root.geometry('%dx%d+%d+%d' % (660,20,210,690))
#pass root object to thread
thread= msgThread(root)
thread.start()
root.mainloop()
app.tcpCliSock.close()
I have read all I could find on this, python.org and Tkinter and Python
Programming.
Is my logic wrong or is it not possible to do this?
Thanks
Daryl
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com