I can't find any explanation of what I am supposed to do to get scrolling working and what any built in Win32 GUI scrolling capability will do for me and if its there how do I activate it.

I did find rob may's posting http://rob.themayfamily.me.uk/perl/win32-gui/scrollbars but I can't quite work out how to apply it to my problem

Here is a simple snippet of code that just draws a couple of labels with the second label going over the status bar and getting cut off at the bottom. There is a sub for scroll events but I don't know what to put in it

I'm trying to get the contents of the main window to scroll up and down in response to the scroll arrows on the right hand side

Am I supposed to just Move() the controls up and down within the main window ?

How do I get the bottom label to play nice with the status bar at the bottom and not go over it ?

I am a casual perl scripter who has written a fair number of Perl console scripts over the years and have been experimenting with win32 gui for a few weeks. I have managed a simple non resizable gui app with buttons and list boxes but for my next project I need to get some controls to scroll inside a window or Groupbox. Its the beginnings of a picture renaming app. I am using ActiveState Perl

use Win32::GUI qw( WS_CLIPCHILDREN ); use warnings; use strict; my $main = Win32::GUI::Window->new( -name => "Main", -title => "Test", -pos => [100, 100], -size => [200, 200], -pushstyle => WS_CLIPCHILDREN, -vscroll => 1, ) or die "new Window"; my $preview = $main->AddLabel( -name => 'label_bitmap', -top => 20, -left => 20, -height => 80, -width => 80, -background => [255,255,255], ); my $preview1 = $main->AddLabel( -name => 'label_bitmap1', -top => 120, -left => 20, -height => 80, -width => 80, -background => [255,255,255], ); my $sb = $main->AddStatusBar(); $main->Show(); Win32::GUI::Dialog(); sub Main_Scroll { print "Scroll control used\n"; } sub Main_Resize { $sb->Move(0, $main->ScaleHeight - $sb->Height); $sb->Resize($main->ScaleWidth, $sb->Height); }

In reply to Win32 GUI scrolling controls within the main window by SteveR

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.