Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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]
[holli]: i don't know. meat and tomatoes don't belong anywhere near each other in my book
[holli]: unless the meat is in sausage form and the tomatoes being ketchup, that is
[Discipulus]: no ragł? i'm sorry..;=)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-11-22 09:25 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (316 votes). Check out past polls.