tk 0.1.0 → 0.4.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.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/MANUAL_tcltklib.eng +0 -2
- data/MANUAL_tcltklib.ja +0 -2
- data/README.ActiveTcl +1 -1
- data/README.md +53 -1
- data/ext/tk/extconf.rb +4 -2
- data/ext/tk/old-extconf.rb +0 -1
- data/ext/tk/tcltklib.c +47 -149
- data/ext/tk/tkutil/extconf.rb +0 -2
- data/ext/tk/tkutil/tkutil.c +6 -9
- data/lib/multi-tk.rb +99 -320
- data/lib/remote-tk.rb +8 -25
- data/lib/tk.rb +49 -130
- data/lib/tk/autoload.rb +3 -3
- data/lib/tk/bgerror.rb +2 -2
- data/lib/tk/bindtag.rb +1 -1
- data/lib/tk/canvas.rb +7 -15
- data/lib/tk/canvastag.rb +11 -19
- data/lib/tk/entry.rb +1 -1
- data/lib/tk/font.rb +1 -1
- data/lib/tk/fontchooser.rb +1 -1
- data/lib/tk/grid.rb +4 -4
- data/lib/tk/image.rb +1 -1
- data/lib/tk/itemconfig.rb +4 -4
- data/lib/tk/itemfont.rb +3 -3
- data/lib/tk/listbox.rb +1 -1
- data/lib/tk/menu.rb +4 -4
- data/lib/tk/menuspec.rb +0 -1
- data/lib/tk/msgcat.rb +5 -5
- data/lib/tk/namespace.rb +14 -34
- data/lib/tk/optiondb.rb +3 -74
- data/lib/tk/optionobj.rb +1 -1
- data/lib/tk/scale.rb +3 -3
- data/lib/tk/scrollable.rb +4 -2
- data/lib/tk/selection.rb +5 -4
- data/lib/tk/text.rb +9 -17
- data/lib/tk/textmark.rb +1 -1
- data/lib/tk/texttag.rb +7 -15
- data/lib/tk/timer.rb +2 -2
- data/lib/tk/tk_mac.rb +18 -18
- data/lib/tk/validation.rb +6 -37
- data/lib/tk/variable.rb +10 -8
- data/lib/tk/virtevent.rb +1 -1
- data/lib/tk/winfo.rb +1 -1
- data/lib/tkextlib/blt/barchart.rb +0 -17
- data/lib/tkextlib/blt/bitmap.rb +1 -1
- data/lib/tkextlib/blt/component.rb +40 -40
- data/lib/tkextlib/blt/dragdrop.rb +6 -6
- data/lib/tkextlib/blt/graph.rb +0 -17
- data/lib/tkextlib/blt/stripchart.rb +0 -17
- data/lib/tkextlib/blt/tabset.rb +16 -31
- data/lib/tkextlib/blt/tree.rb +6 -6
- data/lib/tkextlib/blt/treeview.rb +14 -14
- data/lib/tkextlib/blt/watch.rb +1 -1
- data/lib/tkextlib/bwidget/labelentry.rb +6 -14
- data/lib/tkextlib/bwidget/listbox.rb +13 -29
- data/lib/tkextlib/bwidget/notebook.rb +6 -14
- data/lib/tkextlib/bwidget/progressdlg.rb +2 -2
- data/lib/tkextlib/bwidget/spinbox.rb +6 -14
- data/lib/tkextlib/bwidget/tree.rb +19 -35
- data/lib/tkextlib/itcl/incr_tcl.rb +2 -2
- data/lib/tkextlib/itk/incr_tk.rb +7 -29
- data/lib/tkextlib/iwidgets/calendar.rb +0 -15
- data/lib/tkextlib/iwidgets/entryfield.rb +1 -22
- data/lib/tkextlib/iwidgets/notebook.rb +2 -2
- data/lib/tkextlib/iwidgets/promptdialog.rb +1 -1
- data/lib/tkextlib/iwidgets/scrolledcanvas.rb +6 -14
- data/lib/tkextlib/iwidgets/spinner.rb +1 -1
- data/lib/tkextlib/iwidgets/tabnotebook.rb +2 -2
- data/lib/tkextlib/iwidgets/tabset.rb +1 -1
- data/lib/tkextlib/pkg_checker.rb +1 -1
- data/lib/tkextlib/tcllib/crosshair.rb +2 -2
- data/lib/tkextlib/tcllib/ctext.rb +2 -2
- data/lib/tkextlib/tcllib/plotchart.rb +5 -5
- data/lib/tkextlib/tcllib/tablelist_core.rb +3 -3
- data/lib/tkextlib/tcllib/validator.rb +6 -6
- data/lib/tkextlib/tile.rb +1 -2
- data/lib/tkextlib/tile/style.rb +1 -1
- data/lib/tkextlib/tile/treeview.rb +15 -22
- data/lib/tkextlib/tkDND/tkdnd.rb +63 -24
- data/lib/tkextlib/tkHTML/htmlwidget.rb +1 -1
- data/lib/tkextlib/tktable/tktable.rb +2 -2
- data/lib/tkextlib/treectrl/tktreectrl.rb +13 -21
- data/lib/tkextlib/vu/pie.rb +1 -1
- data/sample/binding_sample.rb +2 -2
- data/sample/cmd_res_test.rb +1 -1
- data/sample/demos-en/widget +21 -21
- data/sample/demos-jp/widget +4 -4
- data/sample/multi-ip_sample.rb +0 -3
- data/sample/multi-ip_sample2.rb +1 -1
- data/sample/resource.en +3 -3
- data/sample/resource.ja +3 -3
- data/sample/tcltklib/sample1.rb +2 -2
- data/sample/tkballoonhelp.rb +2 -2
- data/sample/tkextlib/tkHTML/ss.rb +0 -6
- data/sample/tkmulticolumnlist.rb +2 -2
- data/sample/tkmultilistframe.rb +2 -2
- data/sample/tkoptdb.rb +14 -16
- data/tk.gemspec +7 -8
- metadata +13 -15
- data/ChangeLog.tkextlib +0 -949
- data/old-README.tcltklib.ja +0 -159
- data/sample/binstr_usage.rb +0 -46
- data/sample/remote-ip_sample2.rb +0 -57
- data/sample/safe-tk.rb +0 -132
- data/sample/tkoptdb-safeTk.rb +0 -74
- data/sample/tktree.rb +0 -104
- data/sample/tktree.tcl +0 -305
data/lib/tkextlib/tkDND/tkdnd.rb
CHANGED
|
@@ -80,6 +80,53 @@ module Tk
|
|
|
80
80
|
_setup_subst_table(KEY_TBL, PROC_TBL);
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
+
class DND_SubstText < TkUtil::CallbackSubst
|
|
84
|
+
KEY_TBL = [
|
|
85
|
+
[ ?D, ?d, :data ],
|
|
86
|
+
nil
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
PROC_TBL = [
|
|
90
|
+
[ ?d, proc do |s|
|
|
91
|
+
case TclTkLib::WINDOWING_SYSTEM
|
|
92
|
+
when 'x11', 'win32'
|
|
93
|
+
s.force_encoding('utf-8')
|
|
94
|
+
end
|
|
95
|
+
s
|
|
96
|
+
end
|
|
97
|
+
],
|
|
98
|
+
nil
|
|
99
|
+
]
|
|
100
|
+
_setup_subst_table(KEY_TBL, PROC_TBL);
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class DND_SubstFileList < TkUtil::CallbackSubst
|
|
104
|
+
KEY_TBL = [
|
|
105
|
+
[ ?D, ?d, :data ],
|
|
106
|
+
nil
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
PROC_TBL = [
|
|
110
|
+
[ ?d, proc do |s|
|
|
111
|
+
case TclTkLib::WINDOWING_SYSTEM
|
|
112
|
+
when 'win32'
|
|
113
|
+
s.force_encoding('utf-8')
|
|
114
|
+
TkComm.simplelist(s).map { |x| x.tr('\\', '/') }
|
|
115
|
+
when 'x11'
|
|
116
|
+
s = s.encode('iso8859-1', 'utf-8')
|
|
117
|
+
s.force_encoding('utf-8')
|
|
118
|
+
TkComm.simplelist(s)
|
|
119
|
+
else
|
|
120
|
+
TkComm.simplelist(s)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
],
|
|
124
|
+
nil
|
|
125
|
+
]
|
|
126
|
+
_setup_subst_table(KEY_TBL, PROC_TBL);
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
|
|
83
130
|
module DND
|
|
84
131
|
def self.version
|
|
85
132
|
begin
|
|
@@ -99,24 +146,20 @@ module Tk
|
|
|
99
146
|
end
|
|
100
147
|
end
|
|
101
148
|
|
|
102
|
-
|
|
103
|
-
# event = tk_event_sequence(event)
|
|
104
|
-
# if prior.kind_of?(Numeric)
|
|
105
|
-
# tk_call('dnd', 'bindtarget', @path, type, event,
|
|
106
|
-
# install_bind_for_event_class(DND_Subst, cmd, *args),
|
|
107
|
-
# prior)
|
|
108
|
-
# else
|
|
109
|
-
# tk_call('dnd', 'bindtarget', @path, type, event,
|
|
110
|
-
# install_bind_for_event_class(DND_Subst, cmd, prior, *args))
|
|
111
|
-
# end
|
|
112
|
-
# self
|
|
113
|
-
#end
|
|
114
|
-
def dnd_bindtarget(type, event, *args)
|
|
149
|
+
def dnd_bindtarget(type, event, *args, &block)
|
|
115
150
|
# if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
|
|
116
|
-
|
|
151
|
+
klass = case type
|
|
152
|
+
when 'text/plain'
|
|
153
|
+
DND_SubstText
|
|
154
|
+
when 'text/uri-list'
|
|
155
|
+
DND_SubstFileList
|
|
156
|
+
else
|
|
157
|
+
DND_Subst
|
|
158
|
+
end
|
|
159
|
+
if TkComm._callback_entry?(args[0]) || !block
|
|
117
160
|
cmd = args.shift
|
|
118
161
|
else
|
|
119
|
-
cmd =
|
|
162
|
+
cmd = block
|
|
120
163
|
end
|
|
121
164
|
|
|
122
165
|
prior = 50
|
|
@@ -125,11 +168,11 @@ module Tk
|
|
|
125
168
|
event = tk_event_sequence(event)
|
|
126
169
|
if prior.kind_of?(Numeric)
|
|
127
170
|
tk_call('dnd', 'bindtarget', @path, type, event,
|
|
128
|
-
install_bind_for_event_class(
|
|
171
|
+
install_bind_for_event_class(klass, cmd, *args),
|
|
129
172
|
prior)
|
|
130
173
|
else
|
|
131
174
|
tk_call('dnd', 'bindtarget', @path, type, event,
|
|
132
|
-
install_bind_for_event_class(
|
|
175
|
+
install_bind_for_event_class(klass, cmd, prior, *args))
|
|
133
176
|
end
|
|
134
177
|
self
|
|
135
178
|
end
|
|
@@ -147,16 +190,12 @@ module Tk
|
|
|
147
190
|
end
|
|
148
191
|
end
|
|
149
192
|
|
|
150
|
-
|
|
151
|
-
# tk_call('dnd', 'bindsource', @path, type, cmd, prior)
|
|
152
|
-
# self
|
|
153
|
-
#end
|
|
154
|
-
def dnd_bindsource(type, *args)
|
|
193
|
+
def dnd_bindsource(type, *args, &block)
|
|
155
194
|
# if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
|
|
156
|
-
if TkComm._callback_entry?(args[0]) || !
|
|
195
|
+
if TkComm._callback_entry?(args[0]) || !block
|
|
157
196
|
cmd = args.shift
|
|
158
197
|
else
|
|
159
|
-
cmd =
|
|
198
|
+
cmd = block
|
|
160
199
|
end
|
|
161
200
|
|
|
162
201
|
args = [TkComm::None] if args.empty?
|
|
@@ -132,7 +132,7 @@ class Tk::TkTable::CellTag
|
|
|
132
132
|
|
|
133
133
|
CellTagID_TBL = TkCore::INTERP.create_table
|
|
134
134
|
|
|
135
|
-
(CellTag_ID = ['tktbl:celltag'.freeze,
|
|
135
|
+
(CellTag_ID = ['tktbl:celltag'.freeze, '00000']).instance_eval{
|
|
136
136
|
@mutex = Mutex.new
|
|
137
137
|
def mutex; @mutex; end
|
|
138
138
|
freeze
|
|
@@ -155,7 +155,7 @@ class Tk::TkTable::CellTag
|
|
|
155
155
|
|
|
156
156
|
def initialize(parent, keys=nil)
|
|
157
157
|
@parent = @t = parent
|
|
158
|
-
@tpath
|
|
158
|
+
@tpath = parent.path
|
|
159
159
|
CellTag_ID.mutex.synchronize{
|
|
160
160
|
@path = @id = CellTag_ID.join(TkCore::INTERP._ip_id_)
|
|
161
161
|
CellTag_ID[1].succ!
|
|
@@ -1294,7 +1294,7 @@ class Tk::TreeCtrl
|
|
|
1294
1294
|
|
|
1295
1295
|
def item_state_get(item, *args)
|
|
1296
1296
|
if args.empty?
|
|
1297
|
-
list(tk_send('item', 'state', 'get', item *args))
|
|
1297
|
+
list(tk_send('item', 'state', 'get', item * args))
|
|
1298
1298
|
else
|
|
1299
1299
|
bool(tk_send('item', 'state', 'get', item))
|
|
1300
1300
|
end
|
|
@@ -1420,31 +1420,23 @@ class Tk::TreeCtrl
|
|
|
1420
1420
|
marquee_visible()
|
|
1421
1421
|
end
|
|
1422
1422
|
|
|
1423
|
-
|
|
1424
|
-
# _bind([@path, 'notify', 'bind', obj], event, cmd, *args)
|
|
1425
|
-
# self
|
|
1426
|
-
#end
|
|
1427
|
-
def notify_bind(obj, event, *args)
|
|
1423
|
+
def notify_bind(obj, event, *args, &block)
|
|
1428
1424
|
# if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
|
|
1429
|
-
if TkComm._callback_entry?(args[0]) || !
|
|
1425
|
+
if TkComm._callback_entry?(args[0]) || !block
|
|
1430
1426
|
cmd = args.shift
|
|
1431
1427
|
else
|
|
1432
|
-
cmd =
|
|
1428
|
+
cmd = block
|
|
1433
1429
|
end
|
|
1434
1430
|
_bind([@path, 'notify', 'bind', obj], event, cmd, *args)
|
|
1435
1431
|
self
|
|
1436
1432
|
end
|
|
1437
1433
|
|
|
1438
|
-
|
|
1439
|
-
# _bind_append([@path, 'notify', 'bind', obj], event, cmd, *args)
|
|
1440
|
-
# self
|
|
1441
|
-
#end
|
|
1442
|
-
def notify_bind_append(obj, event, *args)
|
|
1434
|
+
def notify_bind_append(obj, event, *args, &block)
|
|
1443
1435
|
# if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
|
|
1444
|
-
if TkComm._callback_entry?(args[0]) || !
|
|
1436
|
+
if TkComm._callback_entry?(args[0]) || !block
|
|
1445
1437
|
cmd = args.shift
|
|
1446
1438
|
else
|
|
1447
|
-
cmd =
|
|
1439
|
+
cmd = block
|
|
1448
1440
|
end
|
|
1449
1441
|
_bind_append([@path, 'notify', 'bind', obj], event, cmd, *args)
|
|
1450
1442
|
self
|
|
@@ -1475,7 +1467,7 @@ class Tk::TreeCtrl
|
|
|
1475
1467
|
|
|
1476
1468
|
def notify_install(pattern, percents_cmd=nil, &b)
|
|
1477
1469
|
pattern = "<#{pattern}>"
|
|
1478
|
-
percents_cmd =
|
|
1470
|
+
percents_cmd = b if !percents_cmd && b
|
|
1479
1471
|
if percents_cmd
|
|
1480
1472
|
procedure(tk_send('notify', 'install', pattern, percents_cmd))
|
|
1481
1473
|
else
|
|
@@ -1484,7 +1476,7 @@ class Tk::TreeCtrl
|
|
|
1484
1476
|
end
|
|
1485
1477
|
|
|
1486
1478
|
def notify_install_detail(event, detail, percents_cmd=nil, &b)
|
|
1487
|
-
percents_cmd =
|
|
1479
|
+
percents_cmd = b if !percents_cmd && b
|
|
1488
1480
|
if percents_cmd
|
|
1489
1481
|
tk_send('notify', 'install', 'detail', event, detail, percents_cmd)
|
|
1490
1482
|
else
|
|
@@ -1493,7 +1485,7 @@ class Tk::TreeCtrl
|
|
|
1493
1485
|
end
|
|
1494
1486
|
|
|
1495
1487
|
def notify_install_event(event, percents_cmd=nil, &b)
|
|
1496
|
-
percents_cmd =
|
|
1488
|
+
percents_cmd = b if !percents_cmd && b
|
|
1497
1489
|
if percents_cmd
|
|
1498
1490
|
tk_send('notify', 'install', 'event', event, percents_cmd)
|
|
1499
1491
|
else
|
|
@@ -1733,7 +1725,7 @@ end
|
|
|
1733
1725
|
class Tk::TreeCtrl::Column < TkObject
|
|
1734
1726
|
TreeCtrlColumnID_TBL = TkCore::INTERP.create_table
|
|
1735
1727
|
|
|
1736
|
-
(TreeCtrlColumnID = ['treectrl_column'.freeze,
|
|
1728
|
+
(TreeCtrlColumnID = ['treectrl_column'.freeze, '00000']).instance_eval{
|
|
1737
1729
|
@mutex = Mutex.new
|
|
1738
1730
|
def mutex; @mutex; end
|
|
1739
1731
|
freeze
|
|
@@ -1839,7 +1831,7 @@ end
|
|
|
1839
1831
|
class Tk::TreeCtrl::Element < TkObject
|
|
1840
1832
|
TreeCtrlElementID_TBL = TkCore::INTERP.create_table
|
|
1841
1833
|
|
|
1842
|
-
(TreeCtrlElementID = ['treectrl_element'.freeze,
|
|
1834
|
+
(TreeCtrlElementID = ['treectrl_element'.freeze, '00000']).instance_eval{
|
|
1843
1835
|
@mutex = Mutex.new
|
|
1844
1836
|
def mutex; @mutex; end
|
|
1845
1837
|
freeze
|
|
@@ -2277,7 +2269,7 @@ end
|
|
|
2277
2269
|
class Tk::TreeCtrl::Style < TkObject
|
|
2278
2270
|
TreeCtrlStyleID_TBL = TkCore::INTERP.create_table
|
|
2279
2271
|
|
|
2280
|
-
(TreeCtrlStyleID = ['treectrl_style'.freeze,
|
|
2272
|
+
(TreeCtrlStyleID = ['treectrl_style'.freeze, '00000']).instance_eval{
|
|
2281
2273
|
@mutex = Mutex.new
|
|
2282
2274
|
def mutex; @mutex; end
|
|
2283
2275
|
freeze
|
data/lib/tkextlib/vu/pie.rb
CHANGED
|
@@ -118,7 +118,7 @@ end
|
|
|
118
118
|
class Tk::Vu::PieSlice
|
|
119
119
|
SliceID_TBL = TkCore::INTERP.create_table
|
|
120
120
|
|
|
121
|
-
(Pie_Slice_ID = ['vu:pie'.freeze,
|
|
121
|
+
(Pie_Slice_ID = ['vu:pie'.freeze, '00000']).instance_eval{
|
|
122
122
|
@mutex = Mutex.new
|
|
123
123
|
def mutex; @mutex; end
|
|
124
124
|
freeze
|
data/sample/binding_sample.rb
CHANGED
data/sample/cmd_res_test.rb
CHANGED
|
@@ -9,7 +9,7 @@ cmd2 = TkOptionDB.new_proc_class(:ZZZ, [:show_msg, :bye_msg], 3, false, cmd1)
|
|
|
9
9
|
cmd3 = TkOptionDB.new_proc_class(:ZZZ, [:show_msg, :bye_msg], 3, false, b)
|
|
10
10
|
cmd4 = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3){
|
|
11
11
|
def self.__check_proc_string__(str)
|
|
12
|
-
"{|arg| print
|
|
12
|
+
"{|arg| print arg.inspect, ': '; Proc.new#{str}.call(arg)}"
|
|
13
13
|
end
|
|
14
14
|
}
|
|
15
15
|
cmd1.show_msg('cmd1')
|
data/sample/demos-en/widget
CHANGED
|
@@ -582,10 +582,10 @@ end
|
|
|
582
582
|
|
|
583
583
|
# Pseudo-Toplevel support
|
|
584
584
|
module PseudoToplevel_Evaluable
|
|
585
|
-
def pseudo_toplevel_eval(body =
|
|
585
|
+
def pseudo_toplevel_eval(body = nil, &block)
|
|
586
586
|
Thread.current[:TOPLEVEL] = self
|
|
587
587
|
begin
|
|
588
|
-
body.call
|
|
588
|
+
(body || block).call
|
|
589
589
|
ensure
|
|
590
590
|
Thread.current[:TOPLEVEL] = nil
|
|
591
591
|
end
|
|
@@ -605,25 +605,25 @@ module PseudoToplevel_Evaluable
|
|
|
605
605
|
end
|
|
606
606
|
|
|
607
607
|
class Object
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
end
|
|
608
|
+
include(Module.new do
|
|
609
|
+
private
|
|
610
|
+
def method_missing(id, *args)
|
|
611
|
+
begin
|
|
612
|
+
has_top = (top = Thread.current[:TOPLEVEL]) &&
|
|
613
|
+
top.respond_to?(:pseudo_toplevel_evaluable?) &&
|
|
614
|
+
top.pseudo_toplevel_evaluable? &&
|
|
615
|
+
top.respond_to?(id)
|
|
616
|
+
rescue Exception => e
|
|
617
|
+
has_top = false
|
|
618
|
+
end
|
|
620
619
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
620
|
+
if has_top
|
|
621
|
+
top.__send__(id, *args)
|
|
622
|
+
else
|
|
623
|
+
super
|
|
624
|
+
end
|
|
625
625
|
end
|
|
626
|
-
end
|
|
626
|
+
end)
|
|
627
627
|
end
|
|
628
628
|
|
|
629
629
|
class Proc
|
|
@@ -649,10 +649,10 @@ class Proc
|
|
|
649
649
|
end
|
|
650
650
|
|
|
651
651
|
def proc(&b)
|
|
652
|
-
|
|
652
|
+
b
|
|
653
653
|
end
|
|
654
654
|
def lambda(&b)
|
|
655
|
-
|
|
655
|
+
b
|
|
656
656
|
end
|
|
657
657
|
|
|
658
658
|
def _null_binding
|
data/sample/demos-jp/widget
CHANGED
|
@@ -639,10 +639,10 @@ end
|
|
|
639
639
|
|
|
640
640
|
# 疑似トップレベルサポート
|
|
641
641
|
module PseudoToplevel_Evaluable
|
|
642
|
-
def pseudo_toplevel_eval(body =
|
|
642
|
+
def pseudo_toplevel_eval(body = nil, &block)
|
|
643
643
|
Thread.current[:TOPLEVEL] = self
|
|
644
644
|
begin
|
|
645
|
-
body.call
|
|
645
|
+
(body || block).call
|
|
646
646
|
ensure
|
|
647
647
|
Thread.current[:TOPLEVEL] = nil
|
|
648
648
|
end
|
|
@@ -706,10 +706,10 @@ class Proc
|
|
|
706
706
|
end
|
|
707
707
|
|
|
708
708
|
def proc(&b)
|
|
709
|
-
|
|
709
|
+
b
|
|
710
710
|
end
|
|
711
711
|
def lambda(&b)
|
|
712
|
-
|
|
712
|
+
b
|
|
713
713
|
end
|
|
714
714
|
|
|
715
715
|
def _null_binding
|
data/sample/multi-ip_sample.rb
CHANGED
|
@@ -80,9 +80,6 @@ safe_slave1.eval_proc(cmd, 'safe1') # label -> .w00016
|
|
|
80
80
|
safe_slave2.eval_proc(cmd, 'safe2') # label -> .w00020
|
|
81
81
|
cmd.call('master') # label -> .w00024
|
|
82
82
|
|
|
83
|
-
#second_master = MultiTkIp.new(&cmd)
|
|
84
|
-
#second_master = MultiTkIp.new(:safe=>2){p [:second_master, $SAFE]}
|
|
85
|
-
|
|
86
83
|
TkTimer.new(2000, -1, proc{p ['safe1', safe_slave1.deleted?]}).start
|
|
87
84
|
TkTimer.new(2000, -1, proc{p ['safe2', safe_slave2.deleted?]}).start
|
|
88
85
|
TkTimer.new(2000, -1, proc{p ['trusted', trusted_slave.deleted?]}).start
|
data/sample/multi-ip_sample2.rb
CHANGED
|
@@ -13,7 +13,7 @@ cmd = proc{|s|
|
|
|
13
13
|
|
|
14
14
|
TkButton.new(:text=>'b1: p self', :command=>proc{p self}).pack(:fill=>:x)
|
|
15
15
|
sleep s
|
|
16
|
-
TkButton.new(:text=>'b2: p
|
|
16
|
+
TkButton.new(:text=>'b2: p 0', :command=>proc{p 0}).pack(:fill=>:x)
|
|
17
17
|
sleep s
|
|
18
18
|
TkButton.new(:text=>'b3: p MultiTkIp.ip_name',
|
|
19
19
|
:command=>proc{p MultiTkIp.ip_name}).pack(:fill=>:x)
|
data/sample/resource.en
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*BtnFrame.Button.foreground: red
|
|
8
8
|
*hello.text: HELLO
|
|
9
9
|
*quit.text: QUIT
|
|
10
|
-
*BTN_CMD.show_msg: {|arg| print "(
|
|
10
|
+
*BTN_CMD.show_msg: {|arg| print "(0) ";\
|
|
11
11
|
print "Hello!! This is a sample of #{arg}.";\
|
|
12
|
-
print "(<<<
|
|
13
|
-
*BTN_CMD.bye_msg: {print "(
|
|
12
|
+
print "(<<< 0)\n"}
|
|
13
|
+
*BTN_CMD.bye_msg: {print "(0 >>>) Good-bye��(<<< 0)\n"}
|
data/sample/resource.ja
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*BtnFrame.Button.foreground: red
|
|
8
8
|
*hello.text: こんにちは
|
|
9
9
|
*quit.text: 終了
|
|
10
|
-
*BTN_CMD.show_msg: {|arg| print "(
|
|
10
|
+
*BTN_CMD.show_msg: {|arg| print "(0 >>>) ";\
|
|
11
11
|
print "こんにちは!! #{arg} のサンプルです.";\
|
|
12
|
-
print "(<<<
|
|
13
|
-
*BTN_CMD.bye_msg: {print "(
|
|
12
|
+
print "(<<< 0)\n"}
|
|
13
|
+
*BTN_CMD.bye_msg: {print "(0 >>>) さようなら.(<<< 0)\n"}
|
data/sample/tcltklib/sample1.rb
CHANGED
|
@@ -293,7 +293,7 @@ class Test1
|
|
|
293
293
|
def test_checkbutton(ip, parent)
|
|
294
294
|
checkbutton, global, pack = ip.commands().values_at(
|
|
295
295
|
"checkbutton", "global", "pack")
|
|
296
|
-
t1, b1,
|
|
296
|
+
t1, b1, _ = inittoplevel(ip, parent, "checkbutton")
|
|
297
297
|
|
|
298
298
|
## checkbutton
|
|
299
299
|
|
|
@@ -616,7 +616,7 @@ print "start\n"
|
|
|
616
616
|
ip = []
|
|
617
617
|
|
|
618
618
|
# インタプリタ, ウィジェット等の生成.
|
|
619
|
-
for
|
|
619
|
+
for _ in 1 .. n
|
|
620
620
|
ip.push(Test1.new())
|
|
621
621
|
end
|
|
622
622
|
|