alexanderp98 has asked for the wisdom of the Perl Monks concerning the following question:
I wanted to create a vertical scrolling text field within my main window, but wasn't sure about how to do it. I opted for using a multiline text field equal to the size of the main window. However, the scrollbar for the text field isn't visible and if the user is resizing the main window, the text field doesn't resize along with it. If the user enlarges the window the boundary of the text field is visible along with the scrollbar I specified for the textfield. Is there another way to make the entire main window a text field with scrolling abilities or am I so what correct? My intention was to have the main window contain output information for a user when running "ScanLogs".
Currently "ScanLogs" is just a subroutine that spits out status information to my textfield.
From reading all the documentation, it looks like I need to write a routine to handle scrolling, but, correct me if I'm wrong, it looks like the latest version handles scrolling.
I'm new to perl and this is my first attempt at creating a GUI. Thanks for all your help.
my $screen_width = Win32::GUI::GetSystemMetrics(0); my $screen_height = Win32::GUI::GetSystemMetrics(1); $MainMenu = new Win32::GUI::Menu( "&Setup" => "", " > &Configuration" => "Configuration", "&Tests" => "", " > &Scan Drive" => "ScanLogs", "&Help" => "Help", " > &Help" => "Usage", "E&xit" => "Exit", " > E&xit" => "QuitExit", ); $small_sh = $screen_height / 2; $small_sw = $screen_width / 2; my $Main = Win32::GUI::Window->new( -name => "Main", -title => "$program_name v$VERSION", -pos => [ 100, 100 ], -size => [ 600, 400 ], -height => $small_sh, -width => $small_sw, -vscroll => 0, -topmost => 0, -addstyle => WS_CLIPCHILDREN, -left => CW_USEDEFAULT, -menu => $MainMenu, ); our $Main_msgs = $Main->AddTextfield ( -name => "MainMsgs", -multiline => 1, -hscroll => 1, -vscroll => 1, -autohscroll => 1, -autovscroll => 1, -keepselection => 1, -addstyle => WS_CLIPCHILDREN, -left => CW_USEDEFAULT, -pos => [0,0], -size => [$small_sw,$small_sh], );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Scrolling text in a Win32:GUI window
by kejohm (Hermit) on Aug 27, 2011 at 07:58 UTC | |
by alexanderp98 (Novice) on Aug 30, 2011 at 00:58 UTC |