To follow up on my own post, I've found several enticing code snippets (like 
this one: 
http://perl-win32-gui.sourceforge.net/cgi-bin/wiki.cgi?Change_Listview_Item_Color),
 but still no joy.

I've seen lots of variations on hooking CUSTOMDRAW that end up at this line:
substr($lParam, 48, 8, $clrText);

The problem with this is that Win32::GUI (?) throws up an error box that says 
"substr outside of string at xenmong.pl line 172.

If I put in a print length($lParam) it shows that $lParam is 8 bytes, which is 
what I'd expect after finding that lParam is a LONG via google.

I'd love to try what is apparently the "new" method of handling CustomDraw 
discussed here 
http://www.mail-archive.com/perl-win32-gui-cvscommit@lists.sourceforge.net/msg00053.html,
 but I can't find Win32::GUI::CustomDraw anywhere.

What am I missing?

Ken Cornetet 812.482.8499
To err is human - to moo, bovine.

From: activeperl-boun...@listserv.activestate.com 
[mailto:activeperl-boun...@listserv.activestate.com] On Behalf Of Ken Cornetet
Sent: Friday, October 14, 2011 5:03 PM
To: activeperl@listserv.activestate.com
Subject: Change font in Win32::GUI AddListView items

Is it possible to change the font (bold, color,etc) when adding items to a 
Win32::GUI AddListView object?

I've tried passing a font object to no avail

my $fb = new Win32::GUI::Font(-name => "Courier New", -height => 10, -bold => 
0);
$lv->InsertItem(-font => $fb, -item => $i, -text => ["  $s", "", "", "", "", 
"", ""]);

There are the TextColor and TextBKColor methods, but they appear to be global 
to the whole ListView object.

Ken Cornetet 812.482.8499
To err is human - to moo, bovine.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to