Theo_124 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to specify a font in a messageBox, but I can't figure out how to do this (or if it's even possible on Windows).
zentara posted some code here Re: How to get error/info/warning icons in perl /tk which appears to set a font, but it will not run on my machine. When I run zentara's code, I get this error
Tk::Error: bad option "-background": must be -default, -icon, -message +, -parent, -title, or -type at C:/Perl/site/lib/Tk.pm line 318.
I'm using Windows XP with ActiveState Perl 5.8.8 and I'm using Tk 804.028
Here is my simplified code which works...use strict; use warnings; use Tk; my $mw=new MainWindow; my $arial_font = $mw->fontCreate('normal_font', -family => "Arial Unicode MS", -size => "15", # point ); my $mess .= "\nAre these two customers the same?"; my $response = $mw -> messageBox( # -font => 'normal_font', -title => "Duplicate customer codes detec +ted", -message => $mess, -type => 'yesno'); MainLoop;
But when I take the # off the -font line, I get this error...
bad option "-font": must be -default, -icon, -message, -parent, -title +, or -type at C:/Perl/site/lib/Tk.pm line 318.
Is it possible that the Tk in ActiveState Perl does not accept a -font variable for a messageBox while the Unix version does? Thank you very much for any suggestions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't specify font in messageBox
by Sandy (Curate) on Apr 23, 2009 at 21:45 UTC | |
by Theo_124 (Novice) on Apr 23, 2009 at 22:22 UTC | |
by Theo_124 (Novice) on Apr 24, 2009 at 15:15 UTC | |
by Sandy (Curate) on Apr 26, 2009 at 22:40 UTC | |
by Theo_124 (Novice) on Apr 27, 2009 at 14:35 UTC |