Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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();

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://332806]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2018-01-20 04:29 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (226 votes). Check out past polls.