[Tutor] How to force Tkinter scrollbar to move with the cursor without mouse/keyboard?

Hy Python pythonpython@hotmail.com
Thu Jan 9 04:00:02 2003


I guess I found out how to do it now:
   textObject.yview(END)
This will force the scrollbarOject.set() to push the bar to the end...

If you have better ways of achieving the same thing, please let me know.

Thanks.

Hy




>From: "Hy Python" <pythonpython@hotmail.com>
>To: tutor@python.org
>Subject: [Tutor] How to force Tkinter scrollbar to move with the cursor 
>without mouse/keyboard?
>Date: Thu, 09 Jan 2003 06:45:44 +0000
>
>Could someone please tell me:
>How to force Tkinter scrollbar to move with the cursor without 
>mouse/keyboard?
>
>I mean,  when I execute something like:
>    textObject.mark_set(END, END)
>the cursor automatically goes to the end of the textObject in the GUI 
>window, but the scrollbar does NOT move at all. How can I force the 
>scrollbar to move to the end in the GUI window with the cursor?
>
>Thanks a lot for your help!
>
>
>Hy
>P.S.
>
>The ScolledText class I am using:
>
>
>class ScrolledText(Frame):
>	def __init__(self,parent=None,text=""):
>		Frame.__init__(self, parent)
>		self.pack(expand=YES, fill=BOTH)
>		self.makeWidgets()
>		self.setText(text)
>	def makeWidgets(self):
>		sbar=Scrollbar(self)
>		text=Text(self, relief=SUNKEN, width=60, height=15)
>		sbar.config(command=text.yview)
>		text.config(yscrollcommand=sbar.set)
>		sbar.pack(side=RIGHT, fill=Y)
>		text.pack(side=LEFT, expand=YES, fill=BOTH)
>		self.text=text
>	def setText(self,text):
>		self.text.delete('1.0', END)
>		self.text.insert('1.0', text)
>		self.text.mark_set(INSERT, END)
>
>
>_________________________________________________________________
>Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
>http://join.msn.com/?page=features/featuredemail
>
>
>_______________________________________________
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE* 
http://join.msn.com/?page=features/virus