For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > May 2005 > tk environement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author tk environement
God

2005-05-07, 8:57 am

iam under debian testing and i try to have nice police with tk wigets.

the default police is very ugly and sometime it's impossible to read
inside the tk wigets

someone kown where do i can change this default police ?

thanks
God

God

2005-05-07, 8:57 am

not "police" but "font" and sorry for my english ;)

Michael van Nieuwenhuize

2005-05-14, 7:13 pm

God wrote:
> not "police" but "font" and sorry for my english ;)


You should be able to override the default font when starting
your script.

%> tkScript.pl -font "Arial 14"

This should now set all fonts to Arial 14"

If you want to do this without providing the command line
argument you can try. Some of the option* methods.
I have use a resource file that my gui reads before starting
up to change all background colors and fonts.

$mw->optionReadfile("path to resource file")

The file contains the following entries:

*background: wheat2
*foreground: black
*selectColor: maroon
*selectBackground: white
*selectForeground: red
*troughColor: gray60
*disabledBackground: gray85
*disabledForeground: gray60
*activeBackground: #f5edb3
*activeForeground: blue
*Text*foreground: black
*Entry*foreground: black
*font:
-*-lucidatypewriter-bold-r-normal-*-13-*-*-*-*-*-*-*
*Entry*font: -*-courier-medium-r-normal-*-12-*-*-*-*-*-*-*

So you see I have modified all the default behaviors with my
own customization. I just have the script read this file when
it starts up. After that all widgets honor these settings.
So you can try this approach.

See User Customization (chapter 16) in Mastering Perl Tk.

Hope this helps,

Mike

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com