[Tkinter-discuss] Problem facing in lift and tkraise urgent
yogendra_mohan at oxyent-medical.com
Sat Mar 21 21:08:03 CET 2009
Thanks a lot for immediate reply.
Your solution works.
Michael Lange wrote:
> On Sat, 21 Mar 2009 08:35:44 -0700 (PDT)
> YMohan <yogendra_mohan at oxyent-medical.com> wrote:
>> Hi All,
>> I am facing the issues while using the lift or tkraise with create_window
>> objects. its not working. I am trying to do the show one window at a
>> time. I
>> have created two window objects using the create_window and try to launch
>> the first one. The following code I have written
>> from Tkinter import *
>> root = Tk()
>> canvas = Canvas(root, width=300, height=300, bg='white') # 0,0 is top
>> canvas.pack(expand=YES, fill=BOTH) # increases down,
>> def setAbove():
>> # print "after tk raise"
>> widget1 = Frame(canvas, bg='red', height=100, width=100)
>> widget2 = Frame(canvas, bg='blue', height=100, width=100)
>> objectID1=canvas.create_window(100, 100, window=widget1) # embed a
>> objectID2=canvas.create_window(100, 100, window=widget2) # embed a
>> root.after(5000, setAbove)
>> Let me know what am I doing wrong or any other way to do the same?
>>From the canvas man page:
> (...)the stacking order of window items is not affected by any of the
> canvas widget commands; you must use the raise and lower Tk commands
> So the solution is to call widget1.lift() instead of
>> Thanks in advance.
>> View this message in context:
>> Sent from the Python - tkinter-discuss mailing list archive at
>> Tkinter-discuss mailing list
>> Tkinter-discuss at python.org
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
View this message in context: http://www.nabble.com/Problem-facing-in-lift-and-tkraise-urgent-tp22637232p22639838.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
More information about the Tkinter-discuss