Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: (ichimunki) Re: Clearing entry boxes in a GUI?

by ralfthewise (Sexton)
on Jun 21, 2001 at 22:27 UTC ( [id://90481]=note: print w/replies, xml ) Need Help??


in reply to (ichimunki) Re: Clearing entry boxes in a GUI?
in thread Clearing entry boxes in a GUI?

Thanks!
Another question if I may
I have five entry boxes to clear. I used your second -command structure ($Entry->delete(0,'end') and chained it into the code like thus:
$top->Button(-text=>"Save RegEdits to a File", -foreground=>"blue", -command=>sub{save()},
-command => sub { $entry1->delete( 0, 'end' )},
-command => sub { $entry1->delete( 0, 'end' )},
-command => sub { $entry3->delete( 0, 'end' )},
-command => sub { $entry4->delete( 0, 'end' )} )->pack()
But the daisy chained -commands looking at each entry didn't all work. In fact, only the first worked, and for some reason the save fxn at the beginning didn't work either. What am I doing wrong?
john
  • Comment on Re: (ichimunki) Re: Clearing entry boxes in a GUI?

Replies are listed 'Best First'.
(ichimunki) {Re} x 2: Clearing entry boxes in a GUI?
by ichimunki (Priest) on Jun 21, 2001 at 22:38 UTC
    You can only have one -command attribute per Button widget. You might try:
    -command => sub {$e1->delete(0,'end'); $e2->delete(0,'end'); ... $e5->delete(0,'end'); }
    Or better yet, instead of sub, use a reference to an actual subroutine so your button declaration isn't so messy and that way you can call the resulting sub from other places in the script if needed.
      p.s.
      I'm rather new to perlmonks.com. I thought I saw somewhere that I could vote on helpful responses to queries. If so, how do I do that?
      john

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-26 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found