Re: odd behaviour of Scale widget
konovalo <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
>I'm using a Scale widget in my application. Some of it's features
>can be configured during runtime (-from, -to, -resolution, -tickinterval).
>
>I noticed, that the Scale widget is buggy or at least odd behaving
>during this reconfigurations sometimes.
>
>For more see the little test script attached:
>(See attached file: testScale.pl)
>It creates 4 Scales. The topmost can be configured with the
>other 3 Scales. You can try a lot of things there yourself, but
>
>
I noticed your perlTk code different from Tcl code, for example
$mw->Label(-text => "configure 'tickinterval' of SUT:")->pack(-anchor =>
'w');
my $tick = $mw->Scale(-from => 0, -to => 20, -resolution => 1,
-tickinterval => 1,
-orient => 'horizontal', -width => 8, -length =>
300, -sliderlength => 16,
-variable => \$tickVal,
-command => sub{$scale->configure(-resolution =>
$tickVal)})->pack();
you promise configuring tickinterval but instead configure resolution;
-to values are also not consistent.
However, if you have both Tcl/Tk and perlTk of same code, I strongly
advice looking into Tcl::Tk perl module from CPAN.
Tcl::Tk able to run pure-Tcl code at one side, and , from another side,
your perlTk version will work from within Tcl::Tk when you will replace
"use Tk;" line with "use Tcl::Tk qw(:perlTk);"
So it will be easier for you to compare behaviours.
Tcl::Tk translates your perlTk code into Tcl/Tk widget directives, and
final GUI processor will be Tcl/Tk
I often uses both approaches from within same script, and find this
quite convenient.
Note, though, that currently CVS version of Tcl::Tk module contains more
complete documentation, compared to current CPAN version.
Best regards,
Vadim..
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]