|
|
Choosing A Webhost: |
Re: Entry widget to run \&sub_cmd on enter key: msg#00054lang.perl.tk
At 02:59 PM 2/24/2004, Markham, Richard wrote: >lets say I have an Entry widget where I want to run sub_cmd when >the enter key is pressed and the value of $inputcmd would then >be evaluated from within sub_cmd and would lead to some sort of >text displayed on my Text widget. Would I use and Entry widget >or go about it another way. > >my($input) = $frame3->Entry(-width => 100, > -background => 'white', > -foreground => 'black', > -textvariable=> \$inputcmd)->pack; > > >I understand I cant use: -command => sub { \&sub_cmd } >with the Entry widget. use strict; use Tk; my $label = 'Return not pressed.'; my $mw = tkinit; $mw->Label(-textvariable => \$label)->pack; my $e = $mw->Entry->pack; $e->bind('<Key-Return>', \&doit); $e->focus; MainLoop; sub doit { $label = Return pressed.'; } -++**==--++**==--++**==--++**==--++**==--++**==--++**== 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 majordomo@xxxxxxxxxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | widget position, Henry Merryweather |
|---|---|
| Next by Date: | Re: Minimum Perl versions, Nick Ing-Simmons |
| Previous by Thread: | Entry widget to run \&sub_cmd on enter key, Markham, Richard |
| Next by Thread: | widget position, Henry Merryweather |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |