Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Disabling the keyboard inputs in Entry/Text widget

by AnomalousMonk (Archbishop)
on Aug 26, 2022 at 09:25 UTC ( [id://11146446]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Disabling the keyboard inputs in Entry/Text widget
in thread Disabling the keyboard inputs in Entry/Text widget

Maybe something like:

use strict; use warnings; use Tk; my $MW = tkinit; my $show_button_text = 'txt'; my $show_button = $MW->Button( -textvariable => \$show_button_text, -command => sub { print "$show_button_text \n"; }, )->pack(qw(-side top -fill x)); my %add_buttons; for my $add_text (qw(a bb xyz)) { $add_buttons{$add_text} = $MW->Button( -text => $add_text, -command => sub { $show_button_text .= " $add_text"; }, )->pack(qw(-side left -expand 1)); } MainLoop;
Instead of printing, clicking $show_button might do the copy to the other widget. Tested under Strawberry Perl 5.8.9.5 (32-bit). (Update: Also works under Strawberry 5.30.3.1 64-bit.)


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found