Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the position of a Scrolled scollbar

Status
Not open for further replies.

jpasquini

Programmer
Apr 20, 2006
44
US
Hi All,

Has anyone out there found any web page which gives an easy, quick example of how to set the position of a Scrolled scrollbar?

I've heard of:

$widget-> xviewMoveto (fraction); or
$widget-> xview();

or even talk of:

-xscrollcommand -> ['set'=> $scrollbar ]
or perhaps I guess
'scrollbar'=> ((('scroll=><<>?set SCROLL e=mc2(Scrolled)~)))

but none of the manuals seem to be clear, or all the examples I've tired don't work.

Basically I've got eight buttons in frame that are enabled in sequence, one after another. When the fourth button is enabled, it's scrolled off the screen, so you have to manually move the scrollbar with your mouse to the right. I just want to at that point move the scrollbar over automatically so that this button is at the left side, so the user can finish.




 
**** EUREKA ******


I don't know if this information will help anyone, but here was the solution in my case:


The problem was that in this case, the widgets and buttons were actually inside a scrolled Pane, and I didn't realize it [if you saw the code, you might understand why]. Therefore, forget any documentation having to do with setting positions using Scrolled, Scrollbar, or scrolling widgets they don't apply, if they are first within a Pane. There are special ready made methods in the above doc for handling these functions.
 
Ah, nice find, I was playing around with a scrolled Frame and was trying to set the scrollbar's position and it wasn't working very well. ;-)
 
kirsle,

I have found Panes to be the object of choice in a lot of situations. They are simple, quick and do the job well.
As they say in the Perl community, "there's 100 better ways to skin a cat......but at least I'm getting it done"......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top