Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A perltk newbie cuestion access to my textbox?

Status
Not open for further replies.

grimbys

Programmer
Dec 19, 2002
34
0
0
ES
Hi, I'm starting to write gui applications, I've never seen nothing about 'frames and windows' ...

I have a problem:

my $MW = MainWindow -> new;
my $menubar = build_menubar;
my $frame = $MW->Frame(qw/-width 300/)->pack;
my $text = $MW->Text()->pack;
# How can I access to this ($text) 'component' on 'select_file sub'?

sub build_menubar {

my $menubar = $MW->Menu;
$MW->configure(-menu => $menubar);
my $file = $menubar->cascade(-label => '~File');

$file->command(-label => "Open", -command => [\&select_file, $MW]);

$menubar; # return the menubar

}
...
in other file:
my $file = 0;
sub select_file
{
my $MW = $_[0];
my $fs;
$fs = $MW->FileSelect
(-directory => Cwd::cwd(),
-initialfile => "fileselect.pl",
-filter => "*.pl",
-filelabel => "Fichero",
-filelistlabel => "Lista fich",
-dirlabel => "Directorio",
-dirlistlabel => "Lista dir",
-verify => ['-T']
);
$file = $fs->Show;
my $label = $MW->Label(-text => "Your file: $file");
$label->pack;
}

sub nombre_fichero
{
return $fichero;
}
1;

I'd like I could write file content in my textbox, when I open it from menu.
I don't know how to access to my textbox when I'm on 'select_file' sub.
Isn't there a 'select' sub.
I'd like can do something like:
my $text = $MW->Text(-name => "my_text_box");
...
on select_file:
my $text = $MW->select("my_text_box");
Which is select function?

Do you understand my problem?
Thanks you, sorry for my poor english :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top