RE: Change font in Win32::GUI AddListView items

Ken Cornetet <[email protected]> Mon, 17 Oct 2011 10:00:52 -0400
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <DF6A68E27C9C734592018E2317E95836070C580742@nts532.kii.kimball.com>
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/[email protected]/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: [email protected] [mailto:[email protected]] On Behalf Of Ken Cornetet
Sent: Friday, October 14, 2011 5:03 PM
To: [email protected]
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
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs