Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: Perl Tk Scrolled widget callbacks

by zentara (Archbishop)
on Mar 01, 2013 at 17:39 UTC ( #1021304=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Perl Tk Scrolled widget callbacks
in thread Perl Tk Scrolled widget callbacks

The example I gave above works with a Scrolled Text widget as well. Just change the line

my $txt = $mw->Text()->pack(-side => 'top'); #to my $txt = $mw->Scrolled('Text')->pack(-side => 'top');
Another option is to bind mouse button 3 ( right click ) to the $mw to do your change. Supressing the Text menu is up to you.
#!/usr/bin/perl use Tk; my $mw = MainWindow->new; my $txt = $mw->Scrolled('Text')->pack(-side => 'top'); $mw->bind('<Button-3>', sub { print "main control 3 \n" }); MainLoop;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Comment on Re^3: Perl Tk Scrolled widget callbacks
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021304]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (16)
As of 2015-10-07 15:57 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (190 votes), past polls