Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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...

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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-07-28 20:00 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (434 votes). Check out past polls.