3 # This file contains obsolete procedures that people really shouldn't
4 # be using anymore, but which are kept around for backward compatibility.
6 # RCS: @(#) $Id: obsolete.tcl,v 1.4.2.2 2010/01/09 00:54:06 patthoyts Exp $
8 # Copyright (c) 1994 The Regents of the University of California.
9 # Copyright (c) 1994 Sun Microsystems, Inc.
11 # See the file "license.terms" for information on usage and redistribution
12 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 # The procedures below are here strictly for backward compatibility with
16 # Tk version 3.6 and earlier. The procedures are no longer needed, so
17 # they are no-ops. You should not use these procedures anymore, since
18 # they may be removed in some future release.
20 proc tk_menuBar args
{}
21 proc tk_bindForTraversal args
{}
23 # ::tk::classic::restore --
25 # Restore the pre-8.5 (Tk classic) look as the widget defaults for classic
28 # The value following an 'option add' call is the new 8.5 value.
30 namespace eval ::tk::classic {
31 # This may need to be adjusted for some window managers that are
32 # more aggressive with their own Xdefaults (like KDE and CDE)
33 variable prio
"widgetDefault"
36 proc ::tk::classic::restore {args
} {
37 # Restore classic (8.4) look to classic Tk widgets
40 if {[llength $args]} {
42 ::tk::classic::restore_$what
45 foreach cmd
[info procs restore_
*] {
51 proc ::tk::classic::restore_font {args
} {
52 # Many widgets were adjusted from hard-coded defaults to using the
53 # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...)
54 # For restoring compatibility, we only correct size and weighting changes,
55 # as the fonts themselves remained mostly the same.
56 if {[tk windowingsystem
] eq
"x11"} {
57 font configure TkDefaultFont
-weight bold
; # normal
58 font configure TkFixedFont
-size -12 ; # -10
60 # Add these with prio 21 to override value in dialog/msgbox.tcl
61 if {[tk windowingsystem
] eq
"aqua"} {
62 option add
*Dialog.msg.
font system
21; # TkCaptionFont
63 option add
*Dialog.dtl.
font system
21; # TkCaptionFont
64 option add
*ErrorDialog
*Label.
font system
21; # TkCaptionFont
66 option add
*Dialog.msg.
font {Times
12} 21; # TkCaptionFont
67 option add
*Dialog.dtl.
font {Times
10} 21; # TkCaptionFont
68 option add
*ErrorDialog
*Label.
font {Times
-18} 21; # TkCaptionFont
72 proc ::tk::classic::restore_button {args
} {
74 if {[tk windowingsystem
] eq
"x11"} {
75 foreach cls
{Button Radiobutton Checkbutton
} {
76 option add
*$cls.borderWidth
2 $prio; # 1
81 proc ::tk::classic::restore_entry {args
} {
83 # Entry and Spinbox share core defaults
84 foreach cls
{Entry Spinbox
} {
85 if {[tk windowingsystem
] ne
"aqua"} {
86 option add
*$cls.borderWidth
2 $prio; # 1
88 if {[tk windowingsystem
] eq
"x11"} {
89 option add
*$cls.background
"#d9d9d9" $prio; # "white"
90 option add
*$cls.selectBorderWidth
1 $prio; # 0
95 proc ::tk::classic::restore_listbox {args
} {
97 if {[tk windowingsystem
] ne
"win32"} {
98 option add
*Listbox.background
"#d9d9d9" $prio; # "white"
99 option add
*Listbox.activeStyle
"underline" $prio; # "dotbox"
101 if {[tk windowingsystem
] ne
"aqua"} {
102 option add
*Listbox.borderWidth
2 $prio; # 1
104 if {[tk windowingsystem
] eq
"x11"} {
105 option add
*Listbox.selectBorderWidth
1 $prio; # 0
107 # Remove focus into Listbox added for 8.5
109 if {[winfo exists
%W
]} {
110 tk::ListboxBeginSelect %W
[%W index
@%x
,%y
]
115 proc ::tk::classic::restore_menu {args
} {
117 if {[tk windowingsystem
] eq
"x11"} {
118 option add
*Menu.activeBorderWidth
2 $prio; # 1
119 option add
*Menu.borderWidth
2 $prio; # 1
120 option add
*Menu.clickToFocus true
$prio
121 option add
*Menu.useMotifHelp true
$prio
123 if {[tk windowingsystem
] ne
"aqua"} {
124 option add
*Menu.
font "TkDefaultFont" $prio; # "TkMenuFont"
128 proc ::tk::classic::restore_menubutton {args
} {
130 option add
*Menubutton.borderWidth
2 $prio; # 1
133 proc ::tk::classic::restore_message {args
} {
135 option add
*Message.borderWidth
2 $prio; # 1
138 proc ::tk::classic::restore_panedwindow {args
} {
140 option add
*Panedwindow.borderWidth
2 $prio; # 1
141 option add
*Panedwindow.sashWidth
2 $prio; # 3
142 option add
*Panedwindow.sashPad
2 $prio; # 0
143 option add
*Panedwindow.sashRelief raised
$prio; # flat
144 option add
*Panedwindow.opaqueResize
0 $prio; # 1
145 if {[tk windowingsystem
] ne
"win32"} {
146 option add
*Panedwindow.showHandle
1 $prio; # 0
150 proc ::tk::classic::restore_scale {args
} {
152 option add
*Scale.borderWidth
2 $prio; # 1
153 if {[tk windowingsystem
] eq
"x11"} {
154 option add
*Scale.troughColor
"#c3c3c3" $prio; # "#b3b3b3"
158 proc ::tk::classic::restore_scrollbar {args
} {
160 if {[tk windowingsystem
] eq
"x11"} {
161 option add
*Scrollbar.borderWidth
2 $prio; # 1
162 option add
*Scrollbar.highlightThickness
1 $prio; # 0
163 option add
*Scrollbar.width
15 $prio; # 11
164 option add
*Scrollbar.troughColor
"#c3c3c3" $prio; # "#b3b3b3"
168 proc ::tk::classic::restore_text {args
} {
170 if {[tk windowingsystem
] ne
"aqua"} {
171 option add
*Text.borderWidth
2 $prio; # 1
173 if {[tk windowingsystem
] eq
"win32"} {
174 option add
*Text.
font "TkDefaultFont" $prio; # "TkFixedFont"
176 if {[tk windowingsystem
] eq
"x11"} {
177 option add
*Text.background
"#d9d9d9" $prio; # white
178 option add
*Text.selectBorderWidth
1 $prio; # 0