
# <20171011.1959.57>
# It is used only once in fr and is passed the GUI font.
#
# What it does is to A.) find all windows using the default font (the label trick)
# and if a window is, it is reconfigured to the new default which is also
# set up as an "option"
#
# If a window is not using the default, it is assumed that it is managed
# in some other way.

proc tk_setFont { font } {
  global tkFontOld

  set new(Font) $font

  if {![info exists tkFontOld]} {
    set w [label .c14732]
    # set tkFont(font) to the default font...
    set tkFontOld [$w cget -font]
    destroy $w
  }
  # frputs
  tkFontTree . $font
  option add *Font $font
  set tkFontOld $font 
}

proc tkFontTree {w font} {
  global tkFontOld
  if {![catch {$w cget -font} value] && $value == $tkFontOld} {
    # frputs value tkFontOld font
    $w configure -font $font
  } else {
    # frputs w value 
  }
  foreach child [winfo children $w] {
    tkFontTree $child $font
  }
}

