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
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to