Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions

by stefbv (Curate)
on Mar 25, 2013 at 16:47 UTC ( [id://1025346]=note: print w/replies, xml ) Need Help??


in reply to Re^2: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions
in thread wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions

Probably because is not implemented. Using a trick I learned here recently (Re: How to use wxHtmlEasyPrinting), does not show any font related methods:

perl -MWx=:allclasses -le " print for grep/set/i, keys %Wx::ListCtrl:: + "

Stefan.

Update: It is now fixed with the new release of Wx, see Wx 0.9918 Released, thanks to Mark Dootson.

  • Comment on Re^3: wxPerl: is wxListCtrl Get/SetItemFont implemented? and further important questions
  • Download Code

Replies are listed 'Best First'.
Re^4: wxPerl: is wxListCtrl Get/SetItemFont implemented? ( Wx::ListCtrl::GetItemFont, Wx::ListCtrl::SetItemFont )
by Anonymous Monk on Mar 26, 2013 at 00:56 UTC

    Probably because is not implemented.

    :) listctrl->GetItem()->SetFont() is implemented

    $ perl -MWx -le " print for grep/font/i, keys %Wx::ListItem:: " SetFont GetFont

    Although, its really not that hard to implement :) the hard part is figuring out which version of wxWidgets API it was added in

    sub Wx::ListCtrl::GetItemFont { $_[0]->GetItem($_[1])->GetFont } sub Wx::ListCtrl::SetItemFont { $_[0]->GetItem($_[1])->SetFont($_[2]) +}

      AnonymousMonk: Thank you. Using your post, and the info in this: http://wxpython-users.1045709.n5.nabble.com/column-header-doesn-t-change-td2341548.html (showing that this:

      $this->SetItem($item);
      is necessary), I succeeded in changing an item's font in Wx::ListCtrl.
      Here is the font-changing sub:

      sub OnBold { my $this = shift; my $item = $this->GetItem(1); my $f = Wx::Font->new(12, -1, wxNORMAL, wxBOLD, 0, 'times new roman +'); say "In OnBold, \$this= $this, \$item = $item, \$f= $f"; $item->SetFont($f); $this->SetItem($item); } #1 end sub OnBold

      and the entire program (tested):

      Stefan, hdb and James: the object pointers were fine originally (as you can see).

      My next problem: how do you set/change size and font of ListCtrl column headers. (As usual, no documentation). I'll start a new post for that: http://www.perlmonks.org/?node_id=1025489

      Many thanks to all the responders, who spent time on this thread. - Helen

        (As usual, no documentation)

        Can you please tell me what you mean by this?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-19 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found