I just tried changing the font for my test script using RefontTree to re-set the font on my whole program and it will not change the font in the messageBox.

This is very strange because the widget demo DOES use a different font in the messageBox that it displays, but I can't figure out how. The widget demo never CHANGES the font that it uses in the messageBox, but it is a larger bolder font than the one that I always get.

Here is my code that shows the ability to change the font for the whole rest of the program, but the messageBox is always the same

use strict; use warnings; use Tk; use Tk::FontDialog; my $mw=new MainWindow; $mw->Label(-text => "Test")->pack; $mw->Button(-text => "Another test")->pack; $mw->Button(-text => "Use Tk::FontDialog", -command => sub { my $font = $mw->FontDialog->Show; if (defined $font) { $mw->RefontTree(-font => $font); } })->pack; my $mess .= "\nAre these two customers the same?"; $mw->Button(-text => "Test messageBox", -command => sub { my $res = $mw -> messageBox( -title => "This is a test", -message => $mess, -type => 'yesno'); } )->pack; MainLoop;

Does anyone have any ideas here? Or what I could try?

I'd give up, except for the fact that I KNOW it can be done because the widget demo shows it!

Thank you for any tips or advice you might have for me


In reply to Re^3: Can't specify font in messageBox by Theo_124
in thread 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.