OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [libgui/] [library/] [font.tcl] - Blame information for rev 1770

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# font.tcl - Font handling.
2
# Copyright (C) 1997 Cygnus Solutions.
3
# Written by Tom Tromey <tromey@cygnus.com>.
4
 
5
 
6
# This function is called whenever a font preference changes.  We use
7
# this information to update the appropriate symbolic font.
8
proc FONT_track_change {symbolic prefname value} {
9
  eval font configure [list $symbolic] $value
10
}
11
 
12
# Primary interface to font handling.
13
# define_font SYMBOLIC_NAME ARGS
14
# Define a new font, named SYMBOLIC_NAME.  ARGS is the default font
15
# specification; it is a list of options such as those passed to `font
16
# create'.
17
proc define_font {symbolic args} {
18
  # We do a little trick with the names here, by inserting `font' in
19
  # the appropriate place in the name.
20
  set split [split $symbolic /]
21
  set name [join [linsert $split 1 font] /]
22
 
23
  pref define $name $args
24
  eval font create [list $symbolic] [pref get $name]
25
  pref add_hook $name [list FONT_track_change $symbolic]
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.