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.


In reply to Can't specify font in messageBox by Theo_124

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.