Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Scrolling text in a Win32:GUI window

by kejohm (Hermit)
on Aug 27, 2011 at 07:58 UTC ( #922796=note: print w/ replies, xml ) Need Help??


in reply to Scrolling text in a Win32:GUI window

When creating a window, the size specified is for the whole window, which includes the border, titlebar, and minimize, maximize and close buttons (known as the non-client area). When creating a control using this size, it will be bigger than the area of the window used to display controls (known as the client area). You can use the ScaleWidth() and ScaleHeight() methods to get the size of the client area of the window. So in order to create a textfield that takes up all of the window, you can do something like this:

my $scalewidth = $Main->ScaleWidth(); my $scaleheight = $Main->ScaleHeight(); my $Main_msgs = $Main->AddTextfield( ... -size => [$scalewidth, $scaleheight], ... );

In order to make the textfield resize as the window does, you need to respond to the window Resize event. This involves creating a subroutine that will be called by Win32::GUI when the event is triggered. Here is an example:

# The sub is named for the control name and event name sub Main_Resize { my $scalewidth = $Main->ScaleWidth(); my $scaleheight = $Main->ScaleHeight(); $Main_msgs->Resize($scalewidth, $scaleheight); return 1; }


Comment on Re: Scrolling text in a Win32:GUI window
Select or Download Code
Re^2: Scrolling text in a Win32:GUI window
by alexanderp98 (Novice) on Aug 30, 2011 at 00:58 UTC

    Thanks for your help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://922796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-09-17 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (57 votes), past polls