Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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 ( [id://1025421]=note: print w/replies, xml ) Need Help??


in reply to Re^3: 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.

:) 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]) +}

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

    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?

        Anonymous Monk: I mean that I can't find documentation explaining how to change (or set) text, font and size (width and height) of Wx::ListCtrl column headings.

        (see: http://www.perlmonks.org/?node_id=1025489)

Log In?
Username:
Password:

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

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

    No recent polls found