Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to get the width of a console window?

by meetraz (Hermit)
on Jun 07, 2004 at 19:37 UTC ( [id://362081]=note: print w/replies, xml ) Need Help??


in reply to How to get the width of a console window?

For completeness, here's how to do it on Windows:

use strict; use Win32::Console; my $CONSOLE = Win32::Console->new(); my ($width, $height) = $CONSOLE->Size(); # $CONSOLE->Size(80, 25); # force a console size print "Console size is $width x $height\n";

Note that if the user resizes the window after the call to new(), the Size() method will not return the new size. If your application needs to handle resizing, it should create the Win32::Console object each time it needs to read the size.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-25 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found