[Tkinter-discuss] PanedWindow placement of sash
Vasilis Vlachoudis
Vasilis.Vlachoudis at cern.ch
Thu Sep 19 09:15:30 CEST 2013
Hi all,
I am trying to save on exit and restore on startup the placement of the sash in the PanedWindow, with a code like this
from Tkinter import *
tk = Tk()
p = PanedWindow(tk, orient=HORIZONTAL, width=600)
p.pack(expand=YES,fill=BOTH)
f1 = Label(p, text="First", bg="Red")
p.add(f1)
f2 = Label(p, text="Second", bg="Green")
p.add(f2)
p.sash_place(0, 450, 0) # <-----------------------
tk.mainloop()
The sash_place command is ignored. I believe because the window is not created yet and the dimensions are zero.
So if I place an p.update_idletasks() before the sash_place, it works.
Is there a more CLEAN to achieve the task.
Is it recommended to use the update_idletasks before the mainloop?
Thanks in advance
Vasilis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20130919/628b489f/attachment.html>
More information about the Tkinter-discuss
mailing list