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

Re: PerlTk File Input

by mawe (Hermit)
on Jul 19, 2004 at 18:47 UTC ( [id://375644]=note: print w/replies, xml ) Need Help??


in reply to PerlTk File Input

Hi!

It is better done as Joost mentioned, but if you really want to use an entry-widget, you could do it like this:
use Tk; my $file; my $top = new MainWindow; my $ent = $top->Entry(-textvariable=>\$file)->pack(); my $but = $top->Button(-text=>"ShowFile",-command=>\&sub_file)->pack() +; MainLoop(); sub sub_file { print $file; # or whatever }
Hope this helps,

mawe

Replies are listed 'Best First'.
Re^2: PerlTk File Input
by eserte (Deacon) on Jul 20, 2004 at 09:15 UTC
    Or even use Tk::PathEntry instead of Entry. This one lets you use the <Tab> key for completion as in modern shells.
Re^2: PerlTk File Input
by paul99 (Initiate) on Jul 22, 2004 at 09:35 UTC
    Thx,this works fine.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found