Update tcl to version 8.5.13
[msysgit.git] / mingw / lib / tk8.5 / obsolete.tcl
blob3ee7f28616fd5ba98db8f52ae3ae6260208f01f1
1 # obsolete.tcl --
3 # This file contains obsolete procedures that people really shouldn't
4 # be using anymore, but which are kept around for backward compatibility.
6 # Copyright (c) 1994 The Regents of the University of California.
7 # Copyright (c) 1994 Sun Microsystems, Inc.
9 # See the file "license.terms" for information on usage and redistribution
10 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 # The procedures below are here strictly for backward compatibility with
14 # Tk version 3.6 and earlier. The procedures are no longer needed, so
15 # they are no-ops. You should not use these procedures anymore, since
16 # they may be removed in some future release.
18 proc tk_menuBar args {}
19 proc tk_bindForTraversal args {}
21 # ::tk::classic::restore --
23 # Restore the pre-8.5 (Tk classic) look as the widget defaults for classic
24 # Tk widgets.
26 # The value following an 'option add' call is the new 8.5 value.
28 namespace eval ::tk::classic {
29 # This may need to be adjusted for some window managers that are
30 # more aggressive with their own Xdefaults (like KDE and CDE)
31 variable prio "widgetDefault"
34 proc ::tk::classic::restore {args} {
35 # Restore classic (8.4) look to classic Tk widgets
36 variable prio
38 if {[llength $args]} {
39 foreach what $args {
40 ::tk::classic::restore_$what
42 } else {
43 foreach cmd [info procs restore_*] {
44 $cmd
49 proc ::tk::classic::restore_font {args} {
50 # Many widgets were adjusted from hard-coded defaults to using the
51 # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...)
52 # For restoring compatibility, we only correct size and weighting changes,
53 # as the fonts themselves remained mostly the same.
54 if {[tk windowingsystem] eq "x11"} {
55 font configure TkDefaultFont -weight bold ; # normal
56 font configure TkFixedFont -size -12 ; # -10
58 # Add these with prio 21 to override value in dialog/msgbox.tcl
59 if {[tk windowingsystem] eq "aqua"} {
60 option add *Dialog.msg.font system 21; # TkCaptionFont
61 option add *Dialog.dtl.font system 21; # TkCaptionFont
62 option add *ErrorDialog*Label.font system 21; # TkCaptionFont
63 } else {
64 option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont
65 option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont
66 option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont
70 proc ::tk::classic::restore_button {args} {
71 variable prio
72 if {[tk windowingsystem] eq "x11"} {
73 foreach cls {Button Radiobutton Checkbutton} {
74 option add *$cls.borderWidth 2 $prio; # 1
79 proc ::tk::classic::restore_entry {args} {
80 variable prio
81 # Entry and Spinbox share core defaults
82 foreach cls {Entry Spinbox} {
83 if {[tk windowingsystem] ne "aqua"} {
84 option add *$cls.borderWidth 2 $prio; # 1
86 if {[tk windowingsystem] eq "x11"} {
87 option add *$cls.background "#d9d9d9" $prio; # "white"
88 option add *$cls.selectBorderWidth 1 $prio; # 0
93 proc ::tk::classic::restore_listbox {args} {
94 variable prio
95 if {[tk windowingsystem] ne "win32"} {
96 option add *Listbox.background "#d9d9d9" $prio; # "white"
97 option add *Listbox.activeStyle "underline" $prio; # "dotbox"
99 if {[tk windowingsystem] ne "aqua"} {
100 option add *Listbox.borderWidth 2 $prio; # 1
102 if {[tk windowingsystem] eq "x11"} {
103 option add *Listbox.selectBorderWidth 1 $prio; # 0
105 # Remove focus into Listbox added for 8.5
106 bind Listbox <1> {
107 if {[winfo exists %W]} {
108 tk::ListboxBeginSelect %W [%W index @%x,%y]
113 proc ::tk::classic::restore_menu {args} {
114 variable prio
115 if {[tk windowingsystem] eq "x11"} {
116 option add *Menu.activeBorderWidth 2 $prio; # 1
117 option add *Menu.borderWidth 2 $prio; # 1
118 option add *Menu.clickToFocus true $prio
119 option add *Menu.useMotifHelp true $prio
121 if {[tk windowingsystem] ne "aqua"} {
122 option add *Menu.font "TkDefaultFont" $prio; # "TkMenuFont"
126 proc ::tk::classic::restore_menubutton {args} {
127 variable prio
128 option add *Menubutton.borderWidth 2 $prio; # 1
131 proc ::tk::classic::restore_message {args} {
132 variable prio
133 option add *Message.borderWidth 2 $prio; # 1
136 proc ::tk::classic::restore_panedwindow {args} {
137 variable prio
138 option add *Panedwindow.borderWidth 2 $prio; # 1
139 option add *Panedwindow.sashWidth 2 $prio; # 3
140 option add *Panedwindow.sashPad 2 $prio; # 0
141 option add *Panedwindow.sashRelief raised $prio; # flat
142 option add *Panedwindow.opaqueResize 0 $prio; # 1
143 if {[tk windowingsystem] ne "win32"} {
144 option add *Panedwindow.showHandle 1 $prio; # 0
148 proc ::tk::classic::restore_scale {args} {
149 variable prio
150 option add *Scale.borderWidth 2 $prio; # 1
151 if {[tk windowingsystem] eq "x11"} {
152 option add *Scale.troughColor "#c3c3c3" $prio; # "#b3b3b3"
156 proc ::tk::classic::restore_scrollbar {args} {
157 variable prio
158 if {[tk windowingsystem] eq "x11"} {
159 option add *Scrollbar.borderWidth 2 $prio; # 1
160 option add *Scrollbar.highlightThickness 1 $prio; # 0
161 option add *Scrollbar.width 15 $prio; # 11
162 option add *Scrollbar.troughColor "#c3c3c3" $prio; # "#b3b3b3"
166 proc ::tk::classic::restore_text {args} {
167 variable prio
168 if {[tk windowingsystem] ne "aqua"} {
169 option add *Text.borderWidth 2 $prio; # 1
171 if {[tk windowingsystem] eq "win32"} {
172 option add *Text.font "TkDefaultFont" $prio; # "TkFixedFont"
174 if {[tk windowingsystem] eq "x11"} {
175 option add *Text.background "#d9d9d9" $prio; # white
176 option add *Text.selectBorderWidth 1 $prio; # 0