arcadia 0.12.2 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. data/README +25 -14
  2. data/conf/LC/en-UK.LANG +3 -1
  3. data/conf/arcadia.conf +10 -0
  4. data/conf/arcadia.res.rb +29 -1
  5. data/ext/ae-editor/ae-editor.rb +239 -48
  6. data/ext/ae-file-history/ae-file-history.conf +11 -1
  7. data/ext/ae-file-history/ae-file-history.rb +120 -2
  8. data/ext/ae-ruby-debug/ae-ruby-debug.rb +6 -5
  9. data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +7 -3
  10. data/ext/ae-term/ae-term.rb +1 -1
  11. data/lib/a-commons.rb +72 -56
  12. data/lib/a-contracts.rb +23 -1
  13. data/lib/a-core.rb +136 -41
  14. data/lib/a-tkcommons.rb +127 -36
  15. data/tcl/fsdialog/fsdialog.tcl +2 -2
  16. data/tcl/ptwidgets-1.1.0/COPYRIGHT +10 -0
  17. data/tcl/ptwidgets-1.1.0/ChangeLog +194 -0
  18. data/tcl/ptwidgets-1.1.0/README +50 -0
  19. data/tcl/ptwidgets-1.1.0/common/stacktrace.tcl +29 -0
  20. data/tcl/ptwidgets-1.1.0/common/tokenframe.tcl +200 -0
  21. data/tcl/ptwidgets-1.1.0/doc/img/toggleswitch_off.png +0 -0
  22. data/tcl/ptwidgets-1.1.0/doc/img/toggleswitch_on.png +0 -0
  23. data/tcl/ptwidgets-1.1.0/doc/img/tokenentry.png +0 -0
  24. data/tcl/ptwidgets-1.1.0/doc/img/tokensearch_popup_example.png +0 -0
  25. data/tcl/ptwidgets-1.1.0/doc/img/tokensearch_popup_example2.png +0 -0
  26. data/tcl/ptwidgets-1.1.0/doc/img/wmarkentry.png +0 -0
  27. data/tcl/ptwidgets-1.1.0/doc/toggleswitch.html +402 -0
  28. data/tcl/ptwidgets-1.1.0/doc/tokenentry.html +1366 -0
  29. data/tcl/ptwidgets-1.1.0/doc/tokensearch.html +1549 -0
  30. data/tcl/ptwidgets-1.1.0/doc/wmarkentry.html +634 -0
  31. data/tcl/ptwidgets-1.1.0/library/toggleswitch.tcl +432 -0
  32. data/tcl/ptwidgets-1.1.0/library/tokenentry.tcl +2208 -0
  33. data/tcl/ptwidgets-1.1.0/library/tokensearch.tcl +2488 -0
  34. data/tcl/ptwidgets-1.1.0/library/wmarkentry.tcl +630 -0
  35. data/tcl/ptwidgets-1.1.0/pkgIndex.tcl +10 -0
  36. data/tcl/ptwidgets-1.1.0/test/Makefile +3 -0
  37. data/tcl/ptwidgets-1.1.0/test/run.tcl +3 -0
  38. data/tcl/ptwidgets-1.1.0/test/test.tcl +89 -0
  39. data/tcl/ptwidgets-1.1.0/test/toggleswitch.test +562 -0
  40. data/tcl/ptwidgets-1.1.0/test/tokenentry.test +1023 -0
  41. data/tcl/ptwidgets-1.1.0/test/tokensearch.test +1023 -0
  42. data/tcl/ptwidgets-1.1.0/test/wmarkentry.test +1325 -0
  43. data/tcl/themes/altTheme.tcl +101 -0
  44. data/tcl/themes/aquaTheme.tcl +59 -0
  45. data/tcl/themes/clamTheme.tcl +140 -0
  46. data/tcl/themes/classicTheme.tcl +108 -0
  47. data/tcl/themes/pkgIndex.tcl +3 -0
  48. data/tcl/themes/ttk.tcl +176 -0
  49. data/tcl/themes/vistaTheme.tcl +224 -0
  50. data/tcl/themes/winTheme.tcl +80 -0
  51. data/tcl/themes/xpTheme.tcl +65 -0
  52. data/tcl/tkfbox/folder.gif +0 -0
  53. data/tcl/tkfbox/textfile.gif +0 -0
  54. data/tcl/tkfbox/tkfbox.tcl +1 -0
  55. data/tcl/tkfbox/tkfbox.tcl~ +1 -0
  56. data/tcl/tkfbox/updir.xbm +1 -0
  57. metadata +43 -2
@@ -0,0 +1,224 @@
1
+ #
2
+ # Settings for Microsoft Windows Vista and Server 2008
3
+ #
4
+
5
+ # The Vista theme can only be defined on Windows Vista and above. The theme
6
+ # is created in C due to the need to assign a theme-enabled function for
7
+ # detecting when themeing is disabled. On systems that cannot support the
8
+ # Vista theme, there will be no such theme created and we must not
9
+ # evaluate this script.
10
+
11
+ if {"vista" ni [ttk::style theme names]} {
12
+ return
13
+ }
14
+
15
+ namespace eval ttk::theme::vista {
16
+
17
+ ttk::style theme settings vista {
18
+
19
+ ttk::style configure . \
20
+ -background SystemButtonFace \
21
+ -foreground SystemWindowText \
22
+ -selectforeground SystemHighlightText \
23
+ -selectbackground SystemHighlight \
24
+ -font TkDefaultFont \
25
+ ;
26
+
27
+ ttk::style map "." \
28
+ -foreground [list disabled SystemGrayText] \
29
+ ;
30
+
31
+ ttk::style configure TButton -anchor center -padding {1 1} -width -11
32
+ ttk::style configure TRadiobutton -padding 2
33
+ ttk::style configure TCheckbutton -padding 2
34
+ ttk::style configure TMenubutton -padding {8 4}
35
+
36
+ ttk::style element create Menubutton.dropdown vsapi \
37
+ TOOLBAR 4 {{selected active} 6 {selected !active} 5
38
+ disabled 4 pressed 3 active 2 {} 1} \
39
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
40
+
41
+ ttk::style configure TNotebook -tabmargins {2 2 2 0}
42
+ ttk::style map TNotebook.Tab \
43
+ -expand [list selected {2 2 2 2}]
44
+
45
+ # Treeview:
46
+ ttk::style configure Heading -font TkHeadingFont
47
+ ttk::style configure Treeview -background SystemWindow
48
+ ttk::style map Treeview \
49
+ -background [list selected SystemHighlight] \
50
+ -foreground [list selected SystemHighlightText] ;
51
+
52
+ # Label and Toolbutton
53
+ ttk::style configure TLabelframe.Label -foreground "#0046d5"
54
+
55
+ ttk::style configure Toolbutton -padding {4 4}
56
+
57
+ # Combobox
58
+ ttk::style configure TCombobox -padding 2
59
+ ttk::style element create Combobox.field vsapi \
60
+ COMBOBOX 2 {{} 1}
61
+ ttk::style element create Combobox.border vsapi \
62
+ COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1}
63
+ ttk::style element create Combobox.rightdownarrow vsapi \
64
+ COMBOBOX 6 {disabled 4 pressed 3 active 2 {} 1} \
65
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
66
+ ttk::style layout TCombobox {
67
+ Combobox.border -sticky nswe -border 0 -children {
68
+ Combobox.rightdownarrow -side right -sticky ns
69
+ Combobox.padding -expand 1 -sticky nswe -children {
70
+ Combobox.focus -expand 1 -sticky nswe -children {
71
+ Combobox.textarea -sticky nswe
72
+ }
73
+ }
74
+ }
75
+ }
76
+ # Vista.Combobox droplist frame
77
+ ttk::style element create ComboboxPopdownFrame.background vsapi\
78
+ LISTBOX 3 {disabled 4 active 3 focus 2 {} 1}
79
+ ttk::style layout ComboboxPopdownFrame {
80
+ ComboboxPopdownFrame.background -sticky news -border 1 -children {
81
+ ComboboxPopdownFrame.padding -sticky news
82
+ }
83
+ }
84
+ ttk::style map TCombobox \
85
+ -selectbackground [list !focus SystemWindow] \
86
+ -selectforeground [list !focus SystemWindowText] \
87
+ -foreground [list \
88
+ disabled SystemGrayText \
89
+ {readonly focus} SystemHighlightText \
90
+ ] \
91
+ -focusfill [list {readonly focus} SystemHighlight] \
92
+ ;
93
+
94
+ # Entry
95
+ ttk::style configure TEntry -padding {1 1 1 1} ;# Needs lookup
96
+ ttk::style element create Entry.field vsapi \
97
+ EDIT 6 {disabled 4 focus 3 hover 2 {} 1} -padding {2 2 2 2}
98
+ ttk::style element create Entry.background vsapi \
99
+ EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}
100
+ ttk::style layout TEntry {
101
+ Entry.field -sticky news -border 0 -children {
102
+ Entry.background -sticky news -children {
103
+ Entry.padding -sticky news -children {
104
+ Entry.textarea -sticky news
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ttk::style map TEntry \
110
+ -selectbackground [list !focus SystemWindow] \
111
+ -selectforeground [list !focus SystemWindowText] \
112
+ ;
113
+
114
+ # Spinbox
115
+ ttk::style configure TSpinbox -padding 0
116
+ ttk::style element create Spinbox.field vsapi \
117
+ EDIT 9 {disabled 4 focus 3 hover 2 {} 1} -padding {1 1 1 2}
118
+ ttk::style element create Spinbox.background vsapi \
119
+ EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}
120
+ ttk::style element create Spinbox.innerbg vsapi \
121
+ EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}\
122
+ -padding {2 0 15 2}
123
+ ttk::style element create Spinbox.uparrow vsapi \
124
+ SPIN 1 {disabled 4 pressed 3 active 2 {} 1} \
125
+ -padding 1 -halfheight 1 \
126
+ -syssize { SM_CXVSCROLL SM_CYVSCROLL }
127
+ ttk::style element create Spinbox.downarrow vsapi \
128
+ SPIN 2 {disabled 4 pressed 3 active 2 {} 1} \
129
+ -padding 1 -halfheight 1 \
130
+ -syssize { SM_CXVSCROLL SM_CYVSCROLL }
131
+ ttk::style layout TSpinbox {
132
+ Spinbox.field -sticky nswe -children {
133
+ Spinbox.background -sticky news -children {
134
+ Spinbox.padding -sticky news -children {
135
+ Spinbox.innerbg -sticky news -children {
136
+ Spinbox.textarea -expand 1 -sticky {}
137
+ }
138
+ }
139
+ Spinbox.uparrow -side top -sticky ens
140
+ Spinbox.downarrow -side bottom -sticky ens
141
+ }
142
+ }
143
+ }
144
+ ttk::style map TSpinbox \
145
+ -selectbackground [list !focus SystemWindow] \
146
+ -selectforeground [list !focus SystemWindowText] \
147
+ ;
148
+
149
+
150
+ # SCROLLBAR elements (Vista includes a state for 'hover')
151
+ ttk::style element create Vertical.Scrollbar.uparrow vsapi \
152
+ SCROLLBAR 1 {disabled 4 pressed 3 active 2 hover 17 {} 1} \
153
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
154
+ ttk::style element create Vertical.Scrollbar.downarrow vsapi \
155
+ SCROLLBAR 1 {disabled 8 pressed 7 active 6 hover 18 {} 5} \
156
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
157
+ ttk::style element create Vertical.Scrollbar.trough vsapi \
158
+ SCROLLBAR 7 {disabled 4 pressed 3 active 2 hover 5 {} 1}
159
+ ttk::style element create Vertical.Scrollbar.thumb vsapi \
160
+ SCROLLBAR 3 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
161
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
162
+ ttk::style element create Vertical.Scrollbar.grip vsapi \
163
+ SCROLLBAR 9 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
164
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
165
+ ttk::style element create Horizontal.Scrollbar.leftarrow vsapi \
166
+ SCROLLBAR 1 {disabled 12 pressed 11 active 10 hover 19 {} 9} \
167
+ -syssize {SM_CXHSCROLL SM_CYHSCROLL}
168
+ ttk::style element create Horizontal.Scrollbar.rightarrow vsapi \
169
+ SCROLLBAR 1 {disabled 16 pressed 15 active 14 hover 20 {} 13} \
170
+ -syssize {SM_CXHSCROLL SM_CYHSCROLL}
171
+ ttk::style element create Horizontal.Scrollbar.trough vsapi \
172
+ SCROLLBAR 5 {disabled 4 pressed 3 active 2 hover 5 {} 1}
173
+ ttk::style element create Horizontal.Scrollbar.thumb vsapi \
174
+ SCROLLBAR 2 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
175
+ -syssize {SM_CXHSCROLL SM_CYHSCROLL}
176
+ ttk::style element create Horizontal.Scrollbar.grip vsapi \
177
+ SCROLLBAR 8 {disabled 4 pressed 3 active 2 hover 5 {} 1}
178
+
179
+ # Progressbar
180
+ ttk::style element create Horizontal.Progressbar.pbar vsapi \
181
+ PROGRESS 3 {{} 1} -padding 8
182
+ ttk::style layout Horizontal.TProgressbar {
183
+ Horizontal.Progressbar.trough -sticky nswe -children {
184
+ Horizontal.Progressbar.pbar -side left -sticky ns
185
+ }
186
+ }
187
+ ttk::style element create Vertical.Progressbar.pbar vsapi \
188
+ PROGRESS 3 {{} 1} -padding 8
189
+ ttk::style layout Vertical.TProgressbar {
190
+ Vertical.Progressbar.trough -sticky nswe -children {
191
+ Vertical.Progressbar.pbar -side bottom -sticky we
192
+ }
193
+ }
194
+
195
+ # Scale
196
+ ttk::style element create Horizontal.Scale.slider vsapi \
197
+ TRACKBAR 3 {disabled 5 focus 4 pressed 3 active 2 {} 1} \
198
+ -width 6 -height 12
199
+ ttk::style layout Horizontal.TScale {
200
+ Scale.focus -expand 1 -sticky nswe -children {
201
+ Horizontal.Scale.trough -expand 1 -sticky nswe -children {
202
+ Horizontal.Scale.track -sticky we
203
+ Horizontal.Scale.slider -side left -sticky {}
204
+ }
205
+ }
206
+ }
207
+ ttk::style element create Vertical.Scale.slider vsapi \
208
+ TRACKBAR 6 {disabled 5 focus 4 pressed 3 active 2 {} 1} \
209
+ -width 12 -height 6
210
+ ttk::style layout Vertical.TScale {
211
+ Scale.focus -expand 1 -sticky nswe -children {
212
+ Vertical.Scale.trough -expand 1 -sticky nswe -children {
213
+ Vertical.Scale.track -sticky ns
214
+ Vertical.Scale.slider -side top -sticky {}
215
+ }
216
+ }
217
+ }
218
+
219
+ # Treeview
220
+ ttk::style configure Item -padding {4 0 0 0}
221
+
222
+ package provide ttk::theme::vista 1.0
223
+ }
224
+ }
@@ -0,0 +1,80 @@
1
+ #
2
+ # Settings for 'winnative' theme.
3
+ #
4
+
5
+ namespace eval ttk::theme::winnative {
6
+ ttk::style theme settings winnative {
7
+
8
+ ttk::style configure "." \
9
+ -background SystemButtonFace \
10
+ -foreground SystemWindowText \
11
+ -selectforeground SystemHighlightText \
12
+ -selectbackground SystemHighlight \
13
+ -troughcolor SystemScrollbar \
14
+ -font TkDefaultFont \
15
+ ;
16
+
17
+ ttk::style map "." -foreground [list disabled SystemGrayText] ;
18
+ ttk::style map "." -embossed [list disabled 1] ;
19
+
20
+ ttk::style configure TButton \
21
+ -anchor center -width -11 -relief raised -shiftrelief 1
22
+ ttk::style configure TCheckbutton -padding "2 4"
23
+ ttk::style configure TRadiobutton -padding "2 4"
24
+ ttk::style configure TMenubutton \
25
+ -padding "8 4" -arrowsize 3 -relief raised
26
+
27
+ ttk::style map TButton -relief {{!disabled pressed} sunken}
28
+
29
+ ttk::style configure TEntry \
30
+ -padding 2 -selectborderwidth 0 -insertwidth 1
31
+ ttk::style map TEntry \
32
+ -fieldbackground \
33
+ [list readonly SystemButtonFace disabled SystemButtonFace] \
34
+ -selectbackground [list !focus SystemWindow] \
35
+ -selectforeground [list !focus SystemWindowText] \
36
+ ;
37
+
38
+ ttk::style configure TCombobox -padding 2
39
+ ttk::style map TCombobox \
40
+ -selectbackground [list !focus SystemWindow] \
41
+ -selectforeground [list !focus SystemWindowText] \
42
+ -fieldbackground [list \
43
+ readonly SystemButtonFace \
44
+ disabled SystemButtonFace] \
45
+ -foreground [list \
46
+ disabled SystemGrayText \
47
+ {readonly focus} SystemHighlightText \
48
+ ] \
49
+ -focusfill [list {readonly focus} SystemHighlight] \
50
+ ;
51
+
52
+ ttk::style element create ComboboxPopdownFrame.border from default
53
+ ttk::style configure ComboboxPopdownFrame \
54
+ -borderwidth 1 -relief solid
55
+
56
+ ttk::style configure TSpinbox -padding {2 0 16 0}
57
+
58
+ ttk::style configure TLabelframe -borderwidth 2 -relief groove
59
+
60
+ ttk::style configure Toolbutton -relief flat -padding {8 4}
61
+ ttk::style map Toolbutton -relief \
62
+ {disabled flat selected sunken pressed sunken active raised}
63
+
64
+ ttk::style configure TScale -groovewidth 4
65
+
66
+ ttk::style configure TNotebook -tabmargins {2 2 2 0}
67
+ ttk::style configure TNotebook.Tab -padding {3 1} -borderwidth 1
68
+ ttk::style map TNotebook.Tab -expand [list selected {2 2 2 0}]
69
+
70
+ # Treeview:
71
+ ttk::style configure Heading -font TkHeadingFont -relief raised
72
+ ttk::style configure Treeview -background SystemWindow
73
+ ttk::style map Treeview \
74
+ -background [list selected SystemHighlight] \
75
+ -foreground [list selected SystemHighlightText] ;
76
+
77
+ ttk::style configure TProgressbar \
78
+ -background SystemHighlight -borderwidth 0 ;
79
+ }
80
+ }
@@ -0,0 +1,65 @@
1
+ #
2
+ # Settings for 'xpnative' theme
3
+ #
4
+
5
+ namespace eval ttk::theme::xpnative {
6
+
7
+ ttk::style theme settings xpnative {
8
+
9
+ ttk::style configure . \
10
+ -background SystemButtonFace \
11
+ -foreground SystemWindowText \
12
+ -selectforeground SystemHighlightText \
13
+ -selectbackground SystemHighlight \
14
+ -font TkDefaultFont \
15
+ ;
16
+
17
+ ttk::style map "." \
18
+ -foreground [list disabled SystemGrayText] \
19
+ ;
20
+
21
+ ttk::style configure TButton -anchor center -padding {1 1} -width -11
22
+ ttk::style configure TRadiobutton -padding 2
23
+ ttk::style configure TCheckbutton -padding 2
24
+ ttk::style configure TMenubutton -padding {8 4}
25
+
26
+ ttk::style configure TNotebook -tabmargins {2 2 2 0}
27
+ ttk::style map TNotebook.Tab \
28
+ -expand [list selected {2 2 2 2}]
29
+
30
+ # Treeview:
31
+ ttk::style configure Heading -font TkHeadingFont
32
+ ttk::style configure Treeview -background SystemWindow
33
+ ttk::style map Treeview \
34
+ -background [list selected SystemHighlight] \
35
+ -foreground [list selected SystemHighlightText] ;
36
+
37
+ ttk::style configure TLabelframe.Label -foreground "#0046d5"
38
+
39
+ # OR: -padding {3 3 3 6}, which some apps seem to use.
40
+ ttk::style configure TEntry -padding {2 2 2 4}
41
+ ttk::style map TEntry \
42
+ -selectbackground [list !focus SystemWindow] \
43
+ -selectforeground [list !focus SystemWindowText] \
44
+ ;
45
+ ttk::style configure TCombobox -padding 2
46
+ ttk::style map TCombobox \
47
+ -selectbackground [list !focus SystemWindow] \
48
+ -selectforeground [list !focus SystemWindowText] \
49
+ -foreground [list \
50
+ disabled SystemGrayText \
51
+ {readonly focus} SystemHighlightText \
52
+ ] \
53
+ -focusfill [list {readonly focus} SystemHighlight] \
54
+ ;
55
+
56
+ ttk::style configure TSpinbox -padding {2 0 14 0}
57
+ ttk::style map TSpinbox \
58
+ -selectbackground [list !focus SystemWindow] \
59
+ -selectforeground [list !focus SystemWindowText] \
60
+ ;
61
+
62
+ ttk::style configure Toolbutton -padding {4 4}
63
+
64
+ }
65
+ }
Binary file
Binary file
@@ -0,0 +1 @@
1
+ # tkfbox.tcl --
2
  global TKF_IMGDIR
1
3
  set TKF_IMGDIR [file nativename [pwd]]
2
4
  tk_messageBox -message "[tk_getOpenFile -initialfile "[pwd]/untitled.fred"\
3
5
  return [mtkFDialog open $args]
4
6
 
5
7
  return [mtkFDialog save $args]
6
8
  global tkPriv data
7
9
 
8
10
  if [info exists data] {unset data}
9
11
  create-file-dialog
10
12
  mtkFDialog_Config $type $argList
11
13
  mtkFDialog_SetPath $data(selectPath)
12
14
  # 6. Withdraw the window, then update all the geometry information
13
15
  # so we know how big it wants to be, then center the window in the
14
16
  # display and de-iconify it.
15
17
  wm withdraw .tkfd
16
18
  update idletasks
17
19
  set x [expr [winfo screenwidth .tkfd]/2 - [winfo reqwidth .tkfd]/2 \
18
20
  set y [expr [winfo screenheight .tkfd]/2 - [winfo reqheight .tkfd]/2 \
19
21
  wm geom .tkfd [winfo reqwidth .tkfd]x[winfo reqheight .tkfd]+$x+$y
20
22
  wm deiconify .tkfd
21
23
  wm title .tkfd $data(-title)
22
24
  # 7. Set a grab and claim the focus too.
23
25
  set oldFocus [focus]
24
26
  set oldGrab [grab current .tkfd]
25
27
  if {$oldGrab != ""} {
26
28
  }
27
29
  #Mick: changed to grab global
28
30
  grab .tkfd
29
31
  wm transient .tkfd .
30
32
  focus .tkfd.f2.ent
31
33
  .tkfd.f2.ent delete 0 end
32
34
  .tkfd.f2.ent insert 0 $data(selectFile)
33
35
  .tkfd.f2.ent select from 0
34
36
  .tkfd.f2.ent select to end
35
37
  .tkfd.f2.ent icursor end
36
38
  # Ensure the window is fronted
37
39
  raise .tkfd
38
40
 
39
41
  # 8. Wait for the user to respond, then restore the focus and
40
42
  # return the index of the selected button. Restore the focus
41
43
  # before deleting the window, since otherwise the window manager
42
44
  # may take the focus away so we can't redirect it. Finally,
43
45
  # restore any grab that was in effect.
44
46
  tkwait variable tkPriv(selectFilePath)
45
47
  catch {focus $oldFocus}
46
48
  grab release .tkfd
47
49
  wm withdraw .tkfd
48
50
  if {$oldGrab != ""} {
49
51
  }
50
52
  update
51
53
  return $tkPriv(selectFilePath)
52
54
  global TKF_IMGDIR data tkPriv
53
55
  if [winfo exists .tkfd] {destroy .tkfd}
54
56
  toplevel .tkfd -class mtkFDialog
55
57
  wm protocol .tkfd WM_DELETE_WINDOW "mtkFDialog_CancelCmd"
56
58
  # f1: the frame with the directory option menu
57
59
  #
58
60
  set f1 [frame .tkfd.f1]
59
61
  label .tkfd.f1.lab -text "Directory:" -under 0
60
62
  tk_optionMenu .tkfd.f1.menu data(selectPath) ""
61
63
  .tkfd.f1.menu config -takefocus 1 -highlightthickness 2
62
64
  button .tkfd.f1.up -bitmap @[file join $TKF_IMGDIR updir.xbm]
63
65
 
64
66
  pack .tkfd.f1.up -side right -padx 4 -fill both
65
67
  pack .tkfd.f1.lab -side left -padx 4 -fill both
66
68
  pack .tkfd.f1.menu -expand yes -fill both -padx 4
67
69
  # .tkfd.icons: the IconList that list the files and directories.
68
70
  #
69
71
  tkIconList .tkfd.icons\
70
72
  # f2: the frame with the OK button and the "file name" field
71
73
  #
72
74
  frame .tkfd.f2
73
75
  label .tkfd.f2.lab -text "File name:" -anchor e -width 14 -under 6
74
76
  entry .tkfd.f2.ent -bg white
75
77
  # f3: the frame with the cancel button and the file types field
76
78
  #
77
79
  frame .tkfd.f3
78
80
  label .tkfd.f3.lab -text "Files of type:" \
79
81
  menubutton .tkfd.f3.menu -indicatoron 1 -menu .tkfd.f3.menu.m
80
82
  menu .tkfd.f3.menu.m -tearoff 0
81
83
  .tkfd.f3.menu config -takefocus 1 -highlightthickness 2 \
82
84
  # the okBtn is created after the typeMenu so that the keyboard traversal
83
85
  # is in the right order
84
86
  button .tkfd.f2.ok -text OK -under 0 -width 6
85
87
  button .tkfd.f3.cancel -text Cancel -under 0 -width 6
86
88
  # pack the widgets in f2 and f3
87
89
  #
88
90
  pack .tkfd.f2.ok -side right -padx 4 -anchor e
89
91
  pack .tkfd.f2.lab -side left -padx 4
90
92
  pack .tkfd.f2.ent -expand yes -fill both -padx 2 -pady 2
91
93
 
92
94
  pack .tkfd.f3.cancel -side right -padx 4 -anchor w
93
95
  pack .tkfd.f3.lab -side left -padx 4
94
96
  pack .tkfd.f3.menu -expand yes -fill x -side right
95
97
  # Pack all the frames together. We are done with widget construction.
96
98
  #
97
99
  pack .tkfd.f1 -side top -fill x -pady 4
98
100
  pack .tkfd.f3 -side bottom -fill x
99
101
  pack .tkfd.f2 -side bottom -fill x
100
102
  pack .tkfd.icons -expand yes -fill both -padx 4 -pady 2
101
103
  # Set up the event handlers
102
104
  #
103
105
  bind .tkfd.f2.ent <Return> "mtkFDialog_ActivateEnt"
104
106
 
105
107
  .tkfd.f1.up config -command "mtkFDialog_UpDirCmd"
106
108
  .tkfd.f2.ok config -command "mtkFDialog_OkCmd"
107
109
  .tkfd.f3.cancel config -command "mtkFDialog_CancelCmd"
108
110
  bind .tkfd <Alt-d> "focus .tkfd.f1.menu"
109
111
  bind .tkfd <Alt-t> "focus .tkfd.f3.menu"
110
112
  bind .tkfd <Alt-n> "focus .tkfd.f2.ent"
111
113
  bind .tkfd <KeyPress-Escape> "tkButtonInvoke .tkfd.f3.cancel"
112
114
  bind .tkfd <Alt-o> "mtkFDialog_InvokeBtn Open"
113
115
  bind .tkfd <Alt-s> "mtkFDialog_InvokeBtn Save"
114
116
  # Build the focus group for all the entries
115
117
  #
116
118
  tkFocusGroup_Create .tkfd
117
119
  tkFocusGroup_BindIn .tkfd .tkfd.f2.ent "mtkFDialog_EntFocusIn"
118
120
  tkFocusGroup_BindOut .tkfd .tkfd.f2.ent "mtkFDialog_EntFocusOut"
119
121
  # Create images for use in directory lists
120
122
  if ![info exists tkPriv(folderImage)] {
121
123
  }
122
124
  global data
123
125
  set data(type) $type
124
126
 
125
127
  # 1: the configuration specs
126
128
  #
127
129
  set specs {
128
130
  }
129
131
 
130
132
  # 3: parse the arguments
131
133
  #
132
134
  tclParseConfigSpec data $specs "" $argList
133
135
 
134
136
  if {$data(-title) == ""} {
135
137
  }
136
138
 
137
139
  # Mick Changes: Sets the initialdir to the path of initialfile
138
140
  # if initialdir not set.
139
141
  # Always wipes the dir path of initialfile
140
142
  if { $data(-initialfile) != {} } {
141
143
  }
142
144
 
143
145
  # 4: set the default directory and selection according to the -initial
144
146
  # settings
145
147
  #
146
148
  if { $data(-initialdir) == ""} {
147
149
  } else {
148
150
  }
149
151
  # 5. Parse the -filetypes option
150
152
  #
151
153
  set data(-filetypes) [tkFDGetFileTypes $data(-filetypes)]
152
154
  if {$data(-filetypes) == {}} {
153
155
  } else {
154
156
  }
155
157
  wm transient .tkfd $data(-parent)
156
158
  if ![winfo exists $data(-parent)] {
157
159
  }
158
160
  global data tcl_platform
159
161
  set data(selectPath) $path
160
162
  set appPWD [pwd]
161
163
  if { $tcl_platform(platform) == "windows" && $data(selectPath) == "My Computer"} {
162
164
  mtkFDialog_Update
163
165
  my-cd "$appPWD"
164
166
  return
165
167
  }
166
168
  mtkFDialog_Update
167
169
  my-cd "$appPWD"
168
170
  return
169
171
  }
170
172
 
171
173
 
172
174
  if [catch "my-cd \"$data(selectPath)\""] {
173
175
  }
174
176
  # Update the Directory: option menu
175
177
  #
176
178
  set list ""
177
179
  # Mick: allow PCs to select other drives
178
180
  global tcl_platform
179
181
  switch -- $tcl_platform(platform) {
180
182
  "windows" {set list [list "My Computer"]}
181
183
  "macintosh" {set list [list "Desktop"]}
182
184
  }
183
185
  set dir ""
184
186
  foreach subdir [file split $data(selectPath)] {
185
187
  }
186
188
  .tkfd.f1.menu.menu delete 0 end
187
189
  foreach path $list {
188
190
  }
189
191
  # Restore the PWD to the application's PWD
190
192
  #
191
193
  my-cd "$appPWD"
192
194
  # Change the displayed directory
193
195
  mtkFDialog_Update
194
196
  global data tkPriv tcl_platform
195
197
  # If this is the Mac Desktop or PC "My Computer", just show the lists
196
198
  tkf_show-toplevel
197
199
  return
198
200
  }
199
201
  tkf_show-toplevel
200
202
  return
201
203
  }
202
204
  # if the flter isnt set yet, delay the update
203
205
  if {$data(-filetypes) != {}} {
204
206
  }
205
207
 
206
208
  set folder $tkPriv(folderImage)
207
209
  set file $tkPriv(fileImage)
208
210
  # Turn on the busy cursor. BUG?? We haven't disabled X events, though,
209
211
  # so the user may still click and cause havoc ...
210
212
  #
211
213
  set entCursor [.tkfd.f2.ent cget -cursor]
212
214
  set dlgCursor [.tkfd cget -cursor]
213
215
  .tkfd.f2.ent config -cursor watch
214
216
  .tkfd config -cursor watch
215
217
  update idletasks
216
218
 
217
219
  tkIconList_DeleteAll
218
220
  my-cd "$data(selectPath)"
219
221
  set globlist [lsort -dictionary [glob -nocomplain .* *]]
220
222
  delete globlist "."
221
223
  delete globlist ".."
222
224
  # Make the dir list
223
225
  #
224
226
  foreach f $globlist {
225
227
  }
226
228
  # Make the file list
227
229
  #
228
230
  if { $data(filter)!= "*"} {
229
231
  }
230
232
  set top 0
231
233
  foreach f $globlist {
232
234
  }
233
235
  tkIconList_Arrange
234
236
  # turn off the busy cursor.
235
237
  #
236
238
  .tkfd.f2.ent config -cursor $entCursor
237
239
  .tkfd config -cursor $dlgCursor
238
240
  global data
239
241
  set data(filter) [lindex $type 1]
240
242
  .tkfd.f3.menu config -text [lindex $type 0] -indicatoron 1
241
243
  .tkfd.icons.sbar set 0.0 0.0
242
244
  # mick
243
245
  set oldfile [eval ".tkfd.f2.ent get"]
244
246
  if { $oldfile == {}} {set oldfile $data(selectFile)}
245
247
  set data(selectFile) [file rootname $oldfile][file extension [lindex $type 1]]
246
248
  .tkfd.f2.ent delete 0 end
247
249
  .tkfd.f2.ent insert 0 $data(selectFile)
248
250
  .tkfd.f2.ent select from 0
249
251
  .tkfd.f2.ent select to end
250
252
  .tkfd.f2.ent icursor end
251
253
  mtkFDialog_Update
252
254
  set appPWD [pwd]
253
255
  set path [file join $context $text]
254
256
  if [catch {file exists $path}] {
255
257
  }
256
258
  if [file exists $path] {
257
259
  } else {
258
260
  }
259
261
  return [list $flag $directory $file]
260
262
  global data
261
263
  if { [.tkfd.f2.ent get] != ""} {
262
264
  } else {
263
265
  }
264
266
  tkIconList_Unselect
265
267
  if {$data(type) == "open"} {
266
268
  } else {
267
269
  }
268
270
  .tkfd.f2.ent selection clear
269
271
  global data
270
272
  set text [string trim [.tkfd.f2.ent get]]
271
273
  set list [mtkFDialogResolveFile $data(selectPath) $text]
272
274
  set flag [lindex $list 0]
273
275
  set path [lindex $list 1]
274
276
  set file [lindex $list 2]
275
277
 
276
278
  case $flag {
277
279
  }
278
280
  if ![string compare [.tkfd.f2.ok cget -text] $key] {
279
281
  }
280
282
  global data tcl_platform
281
283
  switch -- $tcl_platform(platform) {
282
284
  if { $data(selectPath) != "Desktop"} {
283
285
  }
284
286
  global data
285
287
  set text [tkIconList_Get]
286
288
  if { $text != ""} {
287
289
  }
288
290
  mtkFDialog_ActivateEnt
289
291
  global tkPriv
290
292
  set tkPriv(selectFilePath) ""
291
293
  global data
292
294
  if {$text == ""} {
293
295
  }
294
296
  set file [file join $data(selectPath) $text]
295
297
  if ![file isdirectory $file] {
296
298
  } else {
297
299
  }
298
300
  global data
299
301
  if {$text == ""} {
300
302
  }
301
303
  set file [file join $data(selectPath) $text]
302
304
  if [file isdirectory $file] {
303
305
  } else {
304
306
  }
305
307
  global data tkPriv
306
308
  if ![string compare $selectFilePath ""] {
307
309
  }
308
310
  set tkPriv(selectFilePath) $selectFilePath
309
311
  global data
310
312
  # Configure the widget variables of IconList, according to the command
311
313
  # line arguments.
312
314
  #
313
315
  # 1: the configuration specs
314
316
  #
315
317
  set specs {
316
318
  }
317
319
 
318
320
  # 2: parse the arguments
319
321
  #
320
322
  tclParseConfigSpec data $specs "" $args
321
323
 
322
324
  # Creates an IconList widget by assembling a canvas widget and a
323
325
  # scrollbar widget. Sets all the bindings necessary for the IconList's
324
326
  # operations.
325
327
 
326
328
  frame $w
327
329
  scrollbar $w.sbar -orient horizontal -highlightthickness 0 -takefocus 0
328
330
  canvas $w.canvas -bd 2 -relief sunken -width 400 -height 120 -takefocus 1 -bg white
329
331
  pack $w.sbar -side bottom -fill x -padx 2
330
332
  pack $w.canvas -expand yes -fill both
331
333
 
332
334
  $w.sbar config -command "$w.canvas xview"
333
335
  $w.canvas config -xscrollcommand "$w.sbar set"
334
336
  # Initializes the max icon/text width and height and other variables
335
337
  #
336
338
  set data(maxIW) 1
337
339
  set data(maxIH) 1
338
340
  set data(maxTW) 1
339
341
  set data(maxTH) 1
340
342
  set data(numItems) 0
341
343
  set data(curItem) {}
342
344
  set data(noScroll) 1
343
345
  # Creates the event bindings.
344
346
  #
345
347
  bind $w.canvas <Configure> "tkIconList_Arrange"
346
348
  bind $w.canvas <1> "tkIconList_Btn1 %x %y"
347
349
  bind $w.canvas <B1-Motion> "tkIconList_Motion1 %x %y"
348
350
  bind $w.canvas <Double-1> "tkIconList_Double1 %x %y"
349
351
  bind $w.canvas <ButtonRelease-1> "tkCancelRepeat"
350
352
  bind $w.canvas <B1-Leave> "tkIconList_Leave1 %x %y"
351
353
  bind $w.canvas <B1-Enter> "tkCancelRepeat"
352
354
  bind $w.canvas <Up> "tkIconList_UpDown -1"
353
355
  bind $w.canvas <Down> "tkIconList_UpDown 1"
354
356
  bind $w.canvas <Left> "tkIconList_LeftRight -1"
355
357
  bind $w.canvas <Right> "tkIconList_LeftRight 1"
356
358
  bind $w.canvas <Return> "tkIconList_ReturnKey"
357
359
  bind $w.canvas <KeyPress> "tkIconList_KeyPress %A"
358
360
  bind $w.canvas <Control-KeyPress> ";"
359
361
  bind $w.canvas <Alt-KeyPress> ";"
360
362
  bind $w.canvas <FocusIn> "tkIconList_FocusIn"
361
363
  return $w
362
364
  global tkPriv data
363
365
  set w .tkfd.icons
364
366
  if {![winfo exists $w]} return
365
367
  set x $tkPriv(x)
366
368
  set y $tkPriv(y)
367
369
  if $data(noScroll) {
368
370
  }
369
371
  if {$x >= [winfo width $w.canvas]} {
370
372
  } elseif {$x < 0} {
371
373
  } elseif {$y >= [winfo height $w.canvas]} {
372
374
  } elseif {$y < 0} {
373
375
  } else {
374
376
  }
375
377
  tkIconList_Motion1 $x $y
376
378
  set tkPriv(afterId) [after 50 tkIconList_AutoScan]
377
379
  global data itemList
378
380
  .tkfd.icons.canvas delete all
379
381
  catch {unset data(selected)}
380
382
  catch {unset data(rect)}
381
383
  catch {unset data(list)}
382
384
  catch {unset itemList}
383
385
  set data(numItems) 0
384
386
  set data(curItem) {}
385
387
  global data itemList textList
386
388
  set w .tkfd.icons
387
389
  set iTag [$w.canvas create image 0 0 -image $image -anchor nw]
388
390
  set tTag [$w.canvas create text 0 0 -text $text -anchor nw]
389
391
  set rTag [$w.canvas create rect 0 0 0 0 -fill "" -outline ""]
390
392
 
391
393
  set b [$w.canvas bbox $iTag]
392
394
  set iW [expr [lindex $b 2]-[lindex $b 0]]
393
395
  set iH [expr [lindex $b 3]-[lindex $b 1]]
394
396
  if {$data(maxIW) < $iW} {
395
397
  }
396
398
  if {$data(maxIH) < $iH} {
397
399
  }
398
400
 
399
401
  set b [$w.canvas bbox $tTag]
400
402
  set tW [expr [lindex $b 2]-[lindex $b 0]]
401
403
  set tH [expr [lindex $b 3]-[lindex $b 1]]
402
404
  if {$data(maxTW) < $tW} {
403
405
  }
404
406
  if {$data(maxTH) < $tH} {
405
407
  }
406
408
 
407
409
  lappend data(list) [list $iTag $tTag $rTag $iW $iH $tW $tH $data(numItems)]
408
410
  set itemList($rTag) [list $iTag $tTag $text $data(numItems)]
409
411
  set textList($data(numItems)) [string tolower $text]
410
412
  incr data(numItems)
411
413
  global data
412
414
  set w .tkfd.icons
413
415
  if ![info exists data(list)] {
414
416
  }
415
417
  set W [winfo width $w.canvas]
416
418
  set H [winfo height $w.canvas]
417
419
  set pad [expr [$w.canvas cget -highlightthickness] + \
418
420
  incr W -[expr $pad*2]
419
421
  incr H -[expr $pad*2]
420
422
  set dx [expr $data(maxIW) + $data(maxTW) + 4]
421
423
  if {$data(maxTH) > $data(maxIH)} {
422
424
  } else {
423
425
  }
424
426
  set shift [expr $data(maxIW) + 4]
425
427
  set x [expr $pad * 2]
426
428
  set y [expr $pad * 1]
427
429
  set usedColumn 0
428
430
  foreach pair $data(list) {
429
431
  }
430
432
  if {$usedColumn} {
431
433
  } else {
432
434
  }
433
435
  if {$sW < $W} {
434
436
  } else {
435
437
  }
436
438
  set data(itemsPerColumn) [expr ($H-$pad)/$dy]
437
439
  if {$data(itemsPerColumn) < 1} {
438
440
  }
439
441
  if {$data(curItem) != {}} {
440
442
  }
441
443
  global data
442
444
  set w .tkfd.icons
443
445
  if {$data(-command) != "" && [info exists data(selected)]} {
444
446
  }
445
447
  global data itemList
446
448
  set w .tkfd.icons
447
449
  if $data(noScroll) {
448
450
  }
449
451
  set sRegion [$w.canvas cget -scrollregion]
450
452
  if ![string compare $sRegion {}] {
451
453
  }
452
454
  if ![info exists itemList($rTag)] {
453
455
  }
454
456
  set bbox [$w.canvas bbox $rTag]
455
457
  set pad [expr [$w.canvas cget -highlightthickness] + \
456
458
  set x1 [lindex $bbox 0]
457
459
  set x2 [lindex $bbox 2]
458
460
  incr x1 -[expr $pad * 2]
459
461
  incr x2 -[expr $pad * 1]
460
462
  set cW [expr [winfo width $w.canvas] - $pad*2]
461
463
  set scrollW [expr [lindex $sRegion 2]-[lindex $sRegion 0]+1]
462
464
  set dispX [expr int([lindex [$w.canvas xview] 0]*$scrollW)]
463
465
  set oldDispX $dispX
464
466
  # check if out of the right edge
465
467
  #
466
468
  if {[expr $x2 - $dispX] >= $cW} {
467
469
  }
468
470
  # check if out of the left edge
469
471
  #
470
472
  if {[expr $x1 - $dispX] < 0} {
471
473
  }
472
474
  if {$oldDispX != $dispX} {
473
475
  }
474
476
  global data
475
477
  set w .tkfd.icons
476
478
  tkIconList_Select [$w.canvas find closest \
477
479
  global data itemList
478
480
  set w .tkfd.icons
479
481
  if ![info exists itemList($rTag)] {
480
482
  }
481
483
  set iTag [lindex $itemList($rTag) 0]
482
484
  set tTag [lindex $itemList($rTag) 1]
483
485
  set text [lindex $itemList($rTag) 2]
484
486
  set serial [lindex $itemList($rTag) 3]
485
487
  if ![info exists data(rect)] {
486
488
  set data(rect) [$w.canvas create rect 0 0 0 0 \
487
489
  }
488
490
  $w.canvas lower $data(rect)
489
491
  set bbox [$w.canvas bbox $tTag]
490
492
  eval $w.canvas coords $data(rect) $bbox
491
493
  set data(curItem) $serial
492
494
  set data(selected) $text
493
495
 
494
496
  if {$callBrowse} {
495
497
  }
496
498
  global data
497
499
  set w .tkfd.icons
498
500
  if [info exists data(rect)] {
499
501
  }
500
502
  if [info exists data(selected)] {
501
503
  }
502
504
  set data(curItem) {}
503
505
  global data
504
506
  set w .tkfd.icons
505
507
  if [info exists data(selected)] {
506
508
  } else {
507
509
  }
508
510
  global data
509
511
  focus .tkfd.icons.canvas
510
512
  tkIconList_SelectAtXY $x $y
511
513
  global tkPriv
512
514
  set tkPriv(x) $x
513
515
  set tkPriv(y) $y
514
516
  tkIconList_SelectAtXY $x $y
515
517
  global data
516
518
  if {$data(curItem) != {}} {
517
519
  }
518
520
  tkIconList_Invoke
519
521
  global tkPriv
520
522
  set tkPriv(x) $x
521
523
  set tkPriv(y) $y
522
524
  tkIconList_AutoScan
523
525
  global data
524
526
  if ![info exists data(list)] {
525
527
  }
526
528
  if {$data(curItem) == {}} {
527
529
  }
528
530
  global data
529
531
  if ![info exists data(list)] {
530
532
  }
531
533
  if {$data(curItem) == {}} {
532
534
  } else {
533
535
  }
534
536
  if [string compare $rTag ""] {
535
537
  }
536
538
  global data
537
539
  if ![info exists data(list)] {
538
540
  }
539
541
  if {$data(curItem) == {}} {
540
542
  } else {
541
543
  }
542
544
  if [string compare $rTag ""] {
543
545
  }
544
546
  global tkPriv
545
547
  set w .tkfd.icons
546
548
  append tkPriv(ILAccel,$w) $key
547
549
  tkIconList_Goto $tkPriv(ILAccel,$w)
548
550
  catch {
549
551
  }
550
552
  set tkPriv(ILAccel,$w,afterId) [after 500 tkIconList_Reset]
551
553
  global data textList tkPriv
552
554
 
553
555
  if ![info exists data(list)] {
554
556
  }
555
557
  if {[string length $text] == 0} {
556
558
  }
557
559
  if {$data(curItem) == {} || $data(curItem) == 0} {
558
560
  } else {
559
561
  }
560
562
  set text [string tolower $text]
561
563
  set theIndex -1
562
564
  set less 0
563
565
  set len [string length $text]
564
566
  set len0 [expr $len-1]
565
567
  set i $start
566
568
  # Search forward until we find a filename whose prefix is an exact match
567
569
  # with $text
568
570
  while 1 {
569
571
  }
570
572
  if {$theIndex > -1} {
571
573
  }
572
574
  global tkPriv
573
575
  set w .tkfd.icons
574
576
  catch {unset tkPriv(ILAccel,$w)}
575
577
  global data
576
578
  mtkFDialog_SetPath $data(selectDrive)
577
579
  global data tkPriv tcl_platform
578
580
  # Turn on the busy cursor. BUG?? We haven't disabled X events, though,
579
581
  # so the user may still click and cause havoc ...
580
582
  #
581
583
  set entCursor [.tkfd.f2.ent cget -cursor]
582
584
  set dlgCursor [.tkfd cget -cursor]
583
585
  .tkfd.f2.ent config -cursor watch
584
586
  .tkfd config -cursor watch
585
587
  update idletasks
586
588
 
587
589
  tkIconList_DeleteAll
588
590
  # Make the dir list
589
591
  #
590
592
  foreach drv [file volume] {
591
593
  }
592
594
  tkIconList_Arrange
593
595
  # Update the Directory: option menu
594
596
  #
595
597
  .tkfd.f1.menu.menu delete 0 end
596
598
  set var data(selectPath)
597
599
  switch -- $tcl_platform(platform) {
598
600
  windows {set label "My Computer"}
599
601
  macintosh {set label "Desktop"}
600
602
  }
601
603
 
602
604
  .tkfd.f1.menu.menu add command -label $label -command [list set $var $label]
603
605
  # turn off the busy cursor.
604
606
  .tkfd.f2.ent config -cursor $entCursor
605
607
  .tkfd config -cursor $dlgCursor
606
608
  global tcl_platform
607
609
 
608
610
  if {[lindex $path 1] != ""} {
609
611
  }
610
612
  if { $tcl_platform(platform) == "macintosh" && $path == "Desktop" } {return}
611
613
 
612
614
  cd "$path"
613
615
  global mtkfCURRDIR
614
616
  if ![info exists mtkfCURRDIR] {set mtkfCURRDIR [pwd]}
615
617
  return $mtkfCURRDIR
616
618
  set oldgrab [grab current]
617
619
  if { $oldgrab != {}} {grab release $oldgrab}
618
620
  if {$parent != {}} {
619
621
  } else {
620
622
  }
621
623
  if { $oldgrab != {}} {grab -global $oldgrab}
622
624
  upvar $var list
623
625
  set ix [lsearch -exact $list $value]
624
626
 
625
627
  if {$ix >= 0} {
626
628
  }
627
629
  return $list