I have a scrolled widget in my Perl Tk code. How can I introduce a callback just to check the -wrap value of it and take some action accordingly.
Following is just a snippet of my code :
my $mw = new MainWindow;
my $frame = $mw->Frame()->pack;
my $textbox = $frame->Scrolled('Text',
-scrollbars => 'soe',
-foreground => 'blue',
-background => 'white',
-wrap => 'none',
$textbox->insert('end', "This is scrolled widget.\nThis is scrolled wi
+dget.This is scrolled widget");
I want the callback to be called when I click RightMouseButton > View > Wrap on the scrolled frame and change the Wrap to something.
Please help. Thanks.
My callback should be like below
my $wr = $textbox->Subwidget('scrolled')->cget(-wrap);
if ($wr =~ /\bnone\b/)
# do something
# do something else