Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Re: Pl/Tk

by smackdab (Pilgrim)
on Mar 01, 2004 at 06:53 UTC ( #332806=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Pl/Tk
in thread Pl/Tk

I think it makes it make more "sense" to some programmers who might not know GUIs that well...
I am sure just as many don't like the magic involved ;-)

use Tk; my $v = 'one'; my $t = new MainWindow; my $e = $t->Entry(-textvariable=>\$v)->pack(); my $b = $t->Button(-text=>'Clear', -command=>sub{$v=""})->pack(); MainLoop();


Comment on Re: Re: Re: Pl/Tk
Download Code
Re: Re: Re: Re: Pl/Tk
by graff (Chancellor) on Mar 01, 2004 at 07:22 UTC
    it make more "sense" to some programmers who might not know GUIs that well...

    It can also make more sense to programmers who know GUIs all too well, and who prefer to keep their data-related variables/logic separate from their widget-specific variables/logic.

    And some programmers have additional reasons, involving the use of arrays and hashes to structure the data (and the GUI) in a maintainable fashion. It really can be more sensible to clear a bunch of Entry widgets by iterating over a set of scalar strings -- e.g.:  $_="" for (@ary); -- rather than calling the "delete()" method on a bunch of widgets...

      I was responding to a Tk newbie, offering a common solution.
      I also said others might want a diff option (kinda implied it anyway ;-).
      I didn't suggest using delete().
      I appreciate the advice, but the original poster is who I was trying to help by offering an option, they are free to read the advice of all posters and choose what they like ;-)
      I like that aspect of perlmonks!!!
Re: Re: Re: Re: Pl/Tk
by mawe (Hermit) on Mar 01, 2004 at 07:32 UTC
    Ah, that's new for me (obviously :-)). Thank you!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2014-09-19 13:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (138 votes), past polls