Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^4: Can't specify font in messageBox

by Sandy (Curate)
on Apr 26, 2009 at 22:40 UTC ( #760211=note: print w/ replies, xml ) Need Help??

in reply to Re^3: Can't specify font in messageBox
in thread Can't specify font in messageBox


I think I see the misunderstanding with respect to the demo.

The widget demo runs a program in C:\Perl\lib\Tk\demos\widget_lib. Looking at this code,

sub msgBox { my($demo) = @_; $TOP = $MW->WidgetDemo( -name => $demo, -text => 'Choose the icon and type option of the m +essage box. '. 'Then press the "Message Box" button to s +ee the message box.', -title => 'messageBox Demo', -iconname => 'messageBox', );
you can see that it creates a WidgetDemo object, which is the dialog box that has the large font. This object is defined in the program (same directory).
my %WIDGDEMO; # class hash of active widget demonstrations sub Populate { my($self, $args) = @_; my (%arg_defaults) = ( -name => 'Unknown Demo Name', -font => 'Helvetica 24', ### I changed this! -text => 'Unknown Demo Text', -geometry_manager => 'pack', );
I fiddled with the font size to prove to myself that this is where it can become larger (or smaller if you wish).

However... the messageBox that it creates by pressing the button is not affected by the font size defined in the module.

So, my conclusion is that we cannot adjust the size of the message box font (in windows) using Tk.

You can modify the font size in the windows 'display properties' that applies to all programs.

Good luck,


Comment on Re^4: Can't specify font in messageBox
Select or Download Code
Replies are listed 'Best First'.
Re^5: Can't specify font in messageBox
by Theo_124 (Novice) on Apr 27, 2009 at 14:35 UTC

    Thank you very much for doing all this research

    I still don't entirely "get it", but I'll poke around in the files you mentioned until I understand.

    I guess my only solution is to create my own window with a label and buttons that do what I want. It's a lot more work, but it will get the job done.

    Thanks again

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://760211]
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: (12)
As of 2015-07-28 23:22 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (260 votes), past polls