Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Pl/Tk

by smackdab (Pilgrim)
on Mar 01, 2004 at 05:41 UTC ( [id://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...

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://332790]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found