Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How do i color font in a listbox?

by james28909 (Deacon)
on Jul 24, 2014 at 16:14 UTC ( [id://1094936]=note: print w/replies, xml ) Need Help??


in reply to How do i color font in a listbox? (Solved!!!)

I Have Figured it out lol. anybody who reads this in the future, use listctrl ;)...

$dirname = "$dir/path/"; $lc->DeleteAllItems(); my ($red, $green) = ( wxRED, wxGREEN ); foreach my $file ( <'$dirname'/*> ) { next if -d $file; open( my $FILE, $file ); binmode( $FILE ); $filesize = -s $file; $file =~ s{.*/}{}; $md5 = Digest::MD5->new->addfile($FILE)->hexdigest; if ( $md5s =~ $md5 ) { my $text = ( "Match! | $file | $filesize\n" ); $lc->InsertStringItem( 0, $text ); ( $text ) = Wx::ListItem->new; $text->SetId( 0 ); $text->SetTextColour( $green ); $lc->SetItem( $text ); } else { my $text = ( "Warning! | $file | $filesize\n" ); $lc->InsertStringItem( 0, $text ); ( $text ) = Wx::ListItem->new; $text->SetId( 0 ); $text->SetTextColour( $red ); $lc->SetItem( $text ); } }

this will color each individual item in a listctrl. im not sure if this is the "proper" way to do it but it does work. now i just need to specify a darker shade of green, cz that bright green is like glow in the dark.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-29 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found