[Tkinter-discuss] [Fwd: Re: methods of control PanedWindow]

craf prog at vtr.net
Thu Dec 9 21:01:20 CET 2010


--------- Mensaje reenviado --------
> De: Michael Lange <klappnase at web.de>
> Para: tkinter-discuss at python.org
> Asunto: Re: [Tkinter-discuss] methods of control PanedWindow
> Fecha: Thu, 9 Dec 2010 20:38:41 +0100
> 
> Thus spoketh craf <prog at vtr.net> 
> unto us on Thu, 09 Dec 2010 15:52:43 -0300:
> 
> > I Do learn to work with methods of control PanedWindow.The only that I
> > failed to understand how they are used are:
> > 
> > PanedWindow.proxy_coord()
> > PanedWindow.proxy_forget()
> > PanedWindow.proxy_place(x, y)
> > 
> > 
> > Does anyone know what they are good?
> 
> Probably to move the sash:
> 
> ######################################
> from Tkinter import *
> root = Tk()
> pw = PanedWindow(root)
> pw.pack(fill='both', expand=1)
> l1 = Listbox(pw)
> l2 = Listbox(pw)
> a = pw.add(l1)
> b = pw.add(l2)
> 
> def on_left(ev):
>     x,y = pw.proxy_coord()
>     pw.proxy_place(x-1, y)
> def on_right(ev):
>     x,y = pw.proxy_coord()
>     pw.proxy_place(x+1, y)
> def on_return(ev):
>     pw.sash_place(0, *pw.proxy_coord())
>     pw.proxy_forget()
> 
> pw.update_idletasks()
> pw.proxy_place(*pw.sash_coord(0))
> pw.proxy_forget()
> 
> root.bind('<Left>', on_left)
> root.bind('<Right>', on_right)
> root.bind('<Return>', on_return)
> root.mainloop()
> #####################################
> 
> However I don't know why one would want to do this, either. I'd prefer to
> directly move the sash (as with opaqueresize=True).
> 
> Regards
> 
> Michael
> 
> 
> .-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.
> 
> The more complex the mind, the greater the need for the simplicity of
> play.
> 		-- Kirk, "Shore Leave", stardate 3025.8
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss

Hi Michael.

Thank you very much for giving me a light
I really did not know that these methods were used.

Regards


Cristian Abarzua



More information about the Tkinter-discuss mailing list