Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Wx::FontDialog Problem

by crenz (Priest)
on Mar 30, 2005 at 08:50 UTC ( #443378=note: print w/ replies, xml ) Need Help??


in reply to Wx::FontDialog Problem

I tried it on my machine on Windows, and it does work as PodMaster suggested: It is an object, as you can see using

print " ref Font: " . ref($font) . "\n";

which prints ref Font: Wx::Font on my machine.

By the way, don't forget to use SetInitialFont() and remember the font data to set the initial font displayed to the user, or else your application will forget it's settings. E.g., do this:

sub OnTest { my($self, $event) = @_; my $dialog = Wx::FontDialog->new($self, $self->{fontdata}); $dialog->Create($self); if ($dialog->ShowModal() == wxID_OK) { $self->{fontdata} = $dialog->GetFontData(); my $font = $self->{fontdata}->GetChosenFont(); $self->{fontdata}->SetInitialFont($font); printf("You chose %s %ipt\n", $font->GetFaceName(), $font->GetPointSize()); } else { print "No choice.\n"; } }


Comment on Re: Wx::FontDialog Problem
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (21)
As of 2014-10-20 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (88 votes), past polls