Hello:

My Win32::GUI app has text in the window, and when run on Windows 7, versus
98 or XP, the size of the text in pixels changes.  Is there a way to keep
the text size consistant, pixel wise, across the different operating
systems?  Here is an image showing how it differs, Windows 7 vs Win98...

   http://www.johnwhitney.com/tmp/tmp.jpg

Here is my code for my test program...

#!perl -w
#  Perl text size test 1

use strict ; use warnings ; use Win32::GUI 1.05 qw () ; use constant
G_VERSION => 'Ver 1.1' ;

# Define fonts
my $font1 = new Win32::GUI::Font ( -name => 'Arial'         , -size => 10 )
;
my $font2 = new Win32::GUI::Font ( -name => 'Verdana'       , -size => 10 )
;
my $font3 = new Win32::GUI::Font ( -name => 'Courier New'   , -size => 10 )
;

my $window_main = Win32::GUI::Window -> new ( -title => "Perl text size
tests: " . G_VERSION , -pos => [ 300 , 300 ] , -size => [ 500 , 300 ]
, -background => 0xffffff ) ;

my $window_main_t1 = new Win32::GUI::Label ( $window_main , -text => "Text
1" , -name => 'window_main_t1' , -font => $font1 , -size => [ 100 , 18 ]
, -background => 0xd0d0d0 , -pos => [ 17 , 38 ] ) ;
my $window_main_t2 = new Win32::GUI::Label ( $window_main , -text => "Text
2" , -name => 'window_main_t2' , -font => $font2 , -size => [ 100 , 18 ]
, -background => 0xd0d0d0 , -pos => [ 17 , 58 ] ) ;
my $window_main_t3 = new Win32::GUI::Label ( $window_main , -text => "Text
3" , -name => 'window_main_t3' , -font => $font3 , -size => [ 100 , 18 ]
, -background => 0xd0d0d0 , -pos => [ 17 , 78 ] ) ;

# Add m1...
my $window_main_m1 = new Win32::GUI::Label ( $window_main , -text => ' '
, -name => 'window_main_m1' , -font => $font1 , -size => [ 50 , 18 ]
, -background => 0x808080 , -pos => [  17 , 18 ] ) ;
my $window_main_m2 = new Win32::GUI::Label ( $window_main , -text => ' '
, -name => 'window_main_m2' , -font => $font1 , -size => [ 50 , 18 ]
, -background => 0x909090 , -pos => [  67 , 18 ] ) ;
my $window_main_m3 = new Win32::GUI::Label ( $window_main , -text => ' '
, -name => 'window_main_m3' , -font => $font1 , -size => [ 50 , 18 ]
, -background => 0xA0A0A0 , -pos => [ 117 , 18 ] ) ;
my $window_main_m4 = new Win32::GUI::Label ( $window_main , -text => ' '
, -name => 'window_main_m4' , -font => $font1 , -size => [ 50 , 18 ]
, -background => 0xB0B0B0 , -pos => [ 167 , 18 ] ) ;
my $window_main_m5 = new Win32::GUI::Label ( $window_main , -text => ' '
, -name => 'window_main_m5' , -font => $font1 , -size => [ 50 , 18 ]
, -background => 0xC0C0C0 , -pos => [ 217 , 18 ] ) ;
my $window_main_m6 = new Win32::GUI::Label ( $window_main , -text => ' '
, -name => 'window_main_m6' , -font => $font1 , -size => [ 50 , 18 ]
, -background => 0xD0D0D0 , -pos => [ 267 , 18 ] ) ;

$window_main -> Show () ;

Win32::GUI::Dialog () ;
$window_main -> Hide () ;
exit ( 0 ) ;

John :-)
j...@johnwhitney.com
801 815 9265




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to