Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Pl/Tk

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


in reply to Pl/Tk

posting a code snipit make it easier to help ;-)

Did you use the -textvariable option? It might make what you are trying to do easier...


Comment on Re: Pl/Tk
Re: Re: Pl/Tk
by mawe (Hermit) on Mar 01, 2004 at 06:34 UTC
    $entry->delete(0.0, 'end')
    How does the use of -textvariable make this easier? Am I missing something?
      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();
        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...

        Ah, that's new for me (obviously :-)). Thank you!
      some people think $foo = ""; is easier than what you wrote, go figure

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-11-27 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (178 votes), past polls