Google è il tuo migliore amico, ma questa volta lo sarò anche io :).
Ecco un piccolo esempio per creare una scrollbar orizzontale:
scrollbar = Tkinter.Scrollbar(Tkinter.Tk, orient=Tkinter.HORIZONTAL)
scrollbar.pack(side=Tkinter.LEFT, fill=Tkinter.Y)
Se non hai afferrato il concetto puoi leggere un piccolo esempio che ti
allego.

Per finire ti linko un paio di guide (in Inglese) per le Tkinter in
python: http://infohost.nmt.edu/tcc/help/pubs/tkinter/ (qui parla del
widget Scrollbar
http://infohost.nmt.edu/tcc/help/pubs/tkinter/scrollbar.html)
http://www.ibiblio.org/obp/py4fun/gui/tkPhone.html .

------------------------------------------------------
Luciano Ferraro
Home page: http://ferraro.wordpress.org/
OpenBot's guide: http://ferraro.wordpress.org/openbot/
OpenBot's source: http://code.google.com/p/openbot-python/
from Tkinter import *
root = Tk()
scrollbar_orizzontale = Scrollbar(root, orient=HORIZONTAL)
scrollbar_verticale = Scrollbar(root, orient=VERTICAL)
text = Text(root, yscrollcommand=scrollbar_verticale.set,
            xscrollcommand=scrollbar_orizzontale.set)
# y per orizzontale x per verticale
#  ti ho messo sia quella orizzontale che verticale perche' sicuramente
#  nella tua app userai entrambe le scrollbar, se invece vuoi solo quella
#  orizzontale togli xscrollcommand da text e la var scrollbar_verticale.
text.grid(row=0, column=0, sticky=N+W+S+E)
text.insert(END, "PROVA "*10000) # Ho messo 1.001 PROVA per testare la scrollbar ;)
scrollbar_orizzontale.config(command=text.xview) # Ti collega la scrollbar al tuo widget
scrollbar_orizzontale.grid(row=1, column=0, columnspan=7, sticky=E+W)
scrollbar_verticale.grid(row=0, column=2, sticky=N+S)
scrollbar_verticale.config(command=text.yview)
root.mainloop()
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a