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. |
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.