blob: 25a8ed827c1e5ba17bdee8670b3012b0e22d6bfc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
*** for MacOS X Aqua (Tcl/Tk Aqua) users ***
First of all, please read README.tcltklib to use Tcl/Tk Aqua Framework.
With Tcl/Tk Aqua libraries, current tcltklib somtimes freezes when
using Aqua specific dialogs (e.g. Tk.messageBox).
This is a known bug of Ruby-1.8.4 release.
When you meet the trouble on your GUI, you'll be able to avoid the trouble
by Tcl/Tk's traditional dialogs.
If you want to do that, please call some of the following bits of script
after "reqruie 'tk'".
=================================================================
# use a traditional dialog for Tk.chooseColor()
Tk.ip_eval(<<'EOS')
proc ::tk_chooseColor {args} {
return [eval tk::dialog::color:: $args]
}
EOS
# use a traditional dialog for Tk.getOpenFile() and Tk.getMultipleOpenFile()
Tk.ip_eval(<<'EOS')
proc ::tk_getOpenFile {args} {
if {$::tk_strictMotif} {
return [eval tk::MotifFDialog open $args]
} else {
return [eval ::tk::dialog::file:: open $args]
}
}
EOS
# use a traditional dialog for Tk.getSaveFile() and Tk.getMultipleSaveFile()
Tk.ip_eval(<<'EOS')
proc ::tk_getSaveFile {args} {
if {$::tk_strictMotif} {
return [eval tk::MotifFDialog save $args]
} else {
return [eval ::tk::dialog::file:: save $args]
}
}
EOS
# use a traditional dialog for Tk.messageBox()
Tk.ip_eval(<<'EOS')
proc ::tk_messageBox {args} {
return [eval tk::MessageBox $args]
}
EOS
# use a traditional dialog for Tk.chooseDirectory()
Tk.ip_eval(<<'EOS')
proc ::tk_chooseDirectory {args} {
return [eval ::tk::dialog::file::chooseDir:: $args]
}
EOS
=================================================================
Each of them replaces the platform specific dialog command to the
traditional one.
If you use some MultiTkIp objects, probably, you'll have to call the
bits of script for each MultiTkIp object.
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|