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], );

In reply to Scrolling text in a Win32:GUI window by alexanderp98

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.