Octavian Rasnita wrote:
my $content;
{
local $/;
open(FILE, $file_path);
open(FILE, $file_path) or die "Failed to open $file_path: $!";
*always* check error conditions
$content = <FILE>;
close FILE;
}
Then insert the $content in the Win32::GUI control you want.
For a Textfield that would be
$textfield->Text($content);
undef $content; # unless you really want the text stored twice
The RichEdit control has a method to load itself from a file.
$richedit->Load($file_path);
[all untested]
Regards,
Rob.
----- Original Message -----
From: "Mark Sutfin" <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Sent: Wednesday, August 03, 2005 23:02 PM
Subject: [perl-win32-gui-users] Control for Displaying the contents of a
text file?
Hello,
Newbie has just started experimenting with Win32::GUI. Great stuff. I
see that GetOpenFileName() returns the file I selected from the dialog
box. Which control(s) might easily display the contents of this text
file? I was guessing textfield...? But did not see a method to assign
the content to the control...
TIA,
Mark