John, Question 1:
After looking through the Windows SDK docs, as far as I can tell, labels don't allow you to set the line spacing of the text. The best I can think of is to either choose a font with a large line spacing, or you could create an owner drawn control and draw the text yourself. Question 2: After doing a bit of digging, it seems that if you have themes enabled, the method that Win32::GUI uses to change the background and foreground colours doesn't work. Depending on the version of Perl that you use, the themes may be enabled or not. For example, I use ActiveState Perl 5.12.0 which has themes enabled by default. Robert May released a module called Win32::VisualStyles (it's on CPAN) which you can use to control the styles applied to your window. Simply disable themes before creating the checkbox and the foreground and background colors will be applied. Here is an example: #!perl use strict; use warnings; use feature qw(:5.12); use Win32::GUI qw(); use Win32::GUI::Constants qw(CW_USEDEFAULT); use Win32::VisualStyles qw(:all); # Enable themes only for window, disable for controls SetThemeAppProperties(STAP_ALLOW_NONCLIENT); my $win = Win32::GUI::Window->new( -name => 'win', -size => [ 320, 240 ], -left => CW_USEDEFAULT, ); $win->AddCheckbox( -pos => [ 5, 5 ], -text => 'Checkbox', -foreground => 0x0000ff, -background => 0x00ff00, ); $win->Show(); Win32::GUI::Dialog(); __END__ As an alternative, you could draw the text in the control yourself using an owner drawn checkbox. Hope this helps, Kevin. > Question 1) > > Anyone know how to get multiple lines in a Win32::GUI::Label to spread out > vertially, so there would be an extra 5 pixels between each line? Yes, I > could create multiple labels, one for each line, and spread them out an > extra 5 pixels. But a simple -linespacing => 5 would be nice. Anything > like this in the Win32::GUI world? Below is the label I have. > > my $window_main_text_label = new Win32::GUI::Label > ( > $window_main , > -text => "Line 1 \n Line 2 \n Line 3 \n Line 4 " , > -name => 'window_settings_option_text_label' , > -font => $font , > -pos => [ 195 , 297 ] , > -size => [ 280 , 100 ] > ) ; > > > Question 2) > > With Win32::GUI::RadioButton, and with Win32::GUI::CheckBox I can set and > change the -foreground => 0x000000 value just fine to 0x000000 and 0xff0000 > on my Win98SE PC. But on my XP PC the $window_main_cb -> Change > ( -foreground => 0xff0000 ) and the initial setting of the -foreground => > 0xff0000 has no effect. Just always black. I can change -background colors > on both Win98SE and WinXP platforms fine, but not -foreground. Any > thoughts? My solution is to have the radio button or checkbox without any > text, and add a text label near it that I can change the -foreground > and -background, but this is a kludge I would like to avoid. > > John Whitney > Utah, USA > john at johnwhitney period com > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > 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/ > > > ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ 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/