Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Pipe dream friend, pipe dream
#!/usr/bin/perl -- use strict; use warnings; use Wx; my $f = Wx::Frame->new(undef, -1, ""); ## this, otherwise nothing on s +creen, nada my $l = Wx::ListCtrl->new( $f, -1, [-1,-1], [-1,-1], Wx::wxLC_REPORT() ); $l->InsertColumn( $_, "column $_" ) for 0 .. 3; for my $col( 0 .. 2 ){ for( 0 .. 10 ){ if( $col == 0 ){ $l->InsertStringItem( $_, qq{row $_ col $col} ); } $l->SetItemString( $_, $col, qq{row $_ col $col} ) } $l->SetColumnWidth($col, Wx::wxLIST_AUTOSIZE() ); ## autosize aft +er adding all items } for my $row ( 11 .. 20 ){ $l->AddStringItems ( map { "row $row col $_" } 0 .. 3 ) ; } $l->SetColumnWidth($_, Wx::wxLIST_AUTOSIZE() ) for 0 .. 3; for my $col ( 0 .. 3 ){ warn my $column0 = $l->GetColumn( $col ); $column0->SetText( $column0->GetText . " (?red?)" ); $column0->SetBackgroundColour( Wx::wxRED() ); $column0->SetTextColour( Wx::wxRED() ); warn my $column0font = $column0->GetFont; $column0font->SetPointSize( 12 + $column0font->GetPointSize ); $column0font->SetWeight( Wx::wxFONTWEIGHT_BOLD() ); $column0->SetFont( $column0font); warn $column0->GetFont; $l->Refresh; $l->SetColumn( $col, $column0); warn $l->GetColumn( $col ); } $f->Show(1); exit Wx::SimpleApp->new->MainLoop; sub Wx::ListCtrl::GetItemFont { $_[0]->GetItem($_[1])->GetFont } sub Wx::ListCtrl::SetItemFont { $_[0]->GetItem($_[1])->SetFont($_[2]) +} sub Wx::ListCtrl::AddStringItems { #~ warn "@_\n"; my $l = shift; my $ix = $l->GetItemCount; $l->InsertStringItem( $ix, 'placeholder' ); my $col = 0; while(@_){ #~ warn "$ix $col $_[0] ", $l->SetItemString( $ix, $col, shift @_); $col++; } }

In reply to Re^2: Wx::Perl: How to change/set font and size of Wx::ListCtrl column headings? by Anonymous Monk
in thread Wx::Perl: How to change/set font and size of Wx::ListCtrl column headings? by HelenCr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found