How to control Pmw.ScrolledText scrollbar position?

Bill Scherer scherbi at bam.com
Tue Jun 27 09:24:06 EDT 2000


I had a need for this too, and, fortunately for both of us, I just figured
it out.

# create a Pmw.ScrolledText
self.textWindow = Pmw.ScrolledText(self.master)

#get a reference to the Tk.Text component
self.textWindowText =
self.textWindow._MegaArchetype__componentInfo.get('text')[0]

#to move to the end of self.textWindow call this:
self.textWindowText.see(END)


Enjoy!

-Bill

Maytag Repairman wrote:

> I have this program that I've written which uses Pmw.ScrolledText.
> There are buttons on my GUI which take data from entry fields and
> insert, replace, and append data in a data structure.  The ScrolledText
> is cleared and the updated data structure is displayed in a user-
> friendly format.  Unfortunately, the scrollbar always ends up at the
> top after this operation but the area of most interest to the user is
> the point where the operation on the data structure took place.  I
> can't figure out how to control the position of the scrollbar to move
> it to the area of interest.
>
> Yes, I do realize that I am doing this rather inefficiently by re-
> creating the full text each time but it works well enough for now.
>
> --
> Rob Cupples
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> --
> http://www.python.org/mailman/listinfo/python-list

--
William K. Scherer
Sr. Member of Applications Staff
Verizon Wireless







More information about the Python-list mailing list