achaplot has asked for the wisdom of the Perl Monks concerning the following question:

Hi

I am unable to set scrollbars via xview and vview methods while using HList widget
Here is the code

my $w_FileTree_PWDTree = $w_Frame_Left->Scrolled('DirTree',-scrollbars => 'se',)->pack(-expand => 1 , -fill => 'both', -side => 'top');
If I do something like --

$w_FileTree_PWDTree->xview(moveto => 1)
or
$w_FileTree_PWDTree->xview(<some_path>

There is no affect. What I need is to move the xscrollbar to the rightmost end.
Any help would be appreciated.

Replies are listed 'Best First'.
Re: scroll HList widget
by PodMaster (Abbot) on Aug 08, 2005 at 13:08 UTC
    There is no affect. What I need is to move the xscrollbar to the rightmost end.
    Weel that code doesn't compile (but you knew that). On the other hand, seems to work just fine for me (see below), so if you're still having problems you'll have to show more code.
    use strict; use Tk; my $mw = tkinit; my $t = $mw->Scrolled( 'Text', -scrollbars => 'se', -wrap => 'none', -width => 10, -height => 10 )->pack( -side => 'right' ); $t->insert( '0.0', "yo ho ho and a bottle of rum yo ho ho and a bottle of rum yo ho ho and a bottle of rum yo ho ho and a bottle of rum yo ho ho and a bottle of rum yo ho ho and a bottle of rum" ); # uncomment if you wnat to see "yo ho ho" $t->xview( moveto => 1 ); my $dt = $mw->Scrolled( 'DirTree', -scrollbars => 'se', ) ->pack( -expand => 1, -fill => 'both', -side => 'top' ); # this one has no effect # unless you update first # $dt->update; $dt->xview( moveto => 1 ); $mw->Button( # always works -text => "move it (this works)", -command => sub { $dt->xview( moveto => 1 ); } )->pack; MainLoop;
    update: and of course I've pasted an example of a Text, not a HList widget. I'll update soon. update complete (kept the pirate talk :D).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.