For example: I have a program that the user specifies the font in the
preferences. I then want to make the change automatically. How can
this be done?
Spence
Bruce
Check out how the code for tk_setPalette in $tk_library/palette.tcl
for an example of how colors are reconfigured.
The best way though is to use named fonts from the start (see the
font command). Then you just configure that font, and all the
widgets (which should be using it) automatically adjust.
--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions
Try something like this:
---
bind all <<ChangeFont>> {
catch {%W configure -font [option get %W font widgetDefault]}
foreach w [winfo children %W] {
event generate $w <<ChangeFont>>
}
}
proc ChangeFonts {font1 font2 font3} {
option add *font $font1
option add *text*font $font2
# ...
option add *message*font $font3
event generate . <<ChangeFont>>
}
ChangeFonts Helvetica {Courier 12 bold} {{Times New Roman} 14 bold}
---
>
>Spence
>
Oleg