tk 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/MANUAL_tcltklib.eng +0 -2
  4. data/MANUAL_tcltklib.ja +0 -2
  5. data/README.ActiveTcl +1 -1
  6. data/README.md +43 -0
  7. data/ext/tk/extconf.rb +4 -2
  8. data/ext/tk/old-extconf.rb +0 -1
  9. data/ext/tk/tcltklib.c +46 -148
  10. data/ext/tk/tkutil/extconf.rb +0 -2
  11. data/ext/tk/tkutil/tkutil.c +6 -9
  12. data/lib/multi-tk.rb +95 -315
  13. data/lib/remote-tk.rb +6 -23
  14. data/lib/tk.rb +41 -122
  15. data/lib/tk/bgerror.rb +2 -2
  16. data/lib/tk/bindtag.rb +1 -1
  17. data/lib/tk/canvas.rb +6 -14
  18. data/lib/tk/canvastag.rb +8 -16
  19. data/lib/tk/font.rb +1 -1
  20. data/lib/tk/fontchooser.rb +1 -1
  21. data/lib/tk/image.rb +1 -1
  22. data/lib/tk/menu.rb +4 -4
  23. data/lib/tk/msgcat.rb +5 -5
  24. data/lib/tk/namespace.rb +12 -32
  25. data/lib/tk/optiondb.rb +3 -73
  26. data/lib/tk/scale.rb +2 -2
  27. data/lib/tk/scrollable.rb +4 -2
  28. data/lib/tk/selection.rb +5 -4
  29. data/lib/tk/text.rb +8 -16
  30. data/lib/tk/textmark.rb +1 -1
  31. data/lib/tk/texttag.rb +7 -15
  32. data/lib/tk/timer.rb +2 -2
  33. data/lib/tk/tk_mac.rb +18 -18
  34. data/lib/tk/validation.rb +4 -35
  35. data/lib/tk/variable.rb +7 -5
  36. data/lib/tk/virtevent.rb +1 -1
  37. data/lib/tkextlib/blt/barchart.rb +0 -17
  38. data/lib/tkextlib/blt/bitmap.rb +1 -1
  39. data/lib/tkextlib/blt/component.rb +34 -34
  40. data/lib/tkextlib/blt/dragdrop.rb +6 -6
  41. data/lib/tkextlib/blt/graph.rb +0 -17
  42. data/lib/tkextlib/blt/stripchart.rb +0 -17
  43. data/lib/tkextlib/blt/tabset.rb +16 -31
  44. data/lib/tkextlib/blt/tree.rb +5 -5
  45. data/lib/tkextlib/blt/treeview.rb +14 -14
  46. data/lib/tkextlib/blt/watch.rb +1 -1
  47. data/lib/tkextlib/bwidget/labelentry.rb +6 -14
  48. data/lib/tkextlib/bwidget/listbox.rb +13 -29
  49. data/lib/tkextlib/bwidget/notebook.rb +6 -14
  50. data/lib/tkextlib/bwidget/spinbox.rb +6 -14
  51. data/lib/tkextlib/bwidget/tree.rb +19 -35
  52. data/lib/tkextlib/itcl/incr_tcl.rb +2 -2
  53. data/lib/tkextlib/itk/incr_tk.rb +7 -29
  54. data/lib/tkextlib/iwidgets/calendar.rb +0 -15
  55. data/lib/tkextlib/iwidgets/entryfield.rb +0 -21
  56. data/lib/tkextlib/iwidgets/notebook.rb +2 -2
  57. data/lib/tkextlib/iwidgets/scrolledcanvas.rb +6 -14
  58. data/lib/tkextlib/iwidgets/tabnotebook.rb +2 -2
  59. data/lib/tkextlib/tcllib/ctext.rb +2 -2
  60. data/lib/tkextlib/tcllib/plotchart.rb +5 -5
  61. data/lib/tkextlib/tcllib/validator.rb +6 -6
  62. data/lib/tkextlib/tile.rb +1 -1
  63. data/lib/tkextlib/tile/style.rb +1 -1
  64. data/lib/tkextlib/tile/treeview.rb +13 -20
  65. data/lib/tkextlib/tkDND/tkdnd.rb +6 -22
  66. data/lib/tkextlib/tkHTML/htmlwidget.rb +1 -1
  67. data/lib/tkextlib/tktable/tktable.rb +1 -1
  68. data/lib/tkextlib/treectrl/tktreectrl.rb +12 -20
  69. data/lib/tkextlib/vu/pie.rb +1 -1
  70. data/sample/binding_sample.rb +2 -2
  71. data/sample/cmd_res_test.rb +1 -1
  72. data/sample/demos-en/widget +21 -21
  73. data/sample/demos-jp/widget +4 -4
  74. data/sample/multi-ip_sample.rb +0 -3
  75. data/sample/multi-ip_sample2.rb +1 -1
  76. data/sample/resource.en +3 -3
  77. data/sample/resource.ja +3 -3
  78. data/sample/tcltklib/sample1.rb +2 -2
  79. data/sample/tkballoonhelp.rb +2 -2
  80. data/sample/tkextlib/tkHTML/ss.rb +0 -6
  81. data/sample/tkmulticolumnlist.rb +2 -2
  82. data/sample/tkmultilistframe.rb +2 -2
  83. data/sample/tkoptdb.rb +14 -16
  84. data/tk.gemspec +4 -4
  85. metadata +6 -13
  86. data/ChangeLog.tkextlib +0 -949
  87. data/old-README.tcltklib.ja +0 -159
  88. data/sample/binstr_usage.rb +0 -46
  89. data/sample/remote-ip_sample2.rb +0 -57
  90. data/sample/safe-tk.rb +0 -132
  91. data/sample/tkoptdb-safeTk.rb +0 -74
  92. data/sample/tktree.rb +0 -104
  93. data/sample/tktree.tcl +0 -305
@@ -28,23 +28,6 @@ module Tk::BLT
28
28
  end
29
29
  private :__strval_optkeys
30
30
 
31
- =begin
32
- BarElement_ID = ['blt_stripchart_bar'.freeze, TkUtil.untrust('00000')].freeze
33
-
34
- def bar(elem=nil, keys={})
35
- if elem.kind_of?(Hash)
36
- keys = elem
37
- elem = nil
38
- end
39
- unless elem
40
- elem = BarElement_ID.join(TkCore::INTERP._ip_id_).freeze
41
- BarElement_ID[1].succ!
42
- end
43
- tk_send('bar', elem, keys)
44
- Element.new(self, elem, :without_creating=>true)
45
- end
46
- =end
47
-
48
31
  def extents(item)
49
32
  num_or_str(tk_send_without_enc('extents', item))
50
33
  end
@@ -14,7 +14,7 @@ module Tk::BLT
14
14
 
15
15
  TabID_TBL = TkCore::INTERP.create_table
16
16
 
17
- (TabsetTab_ID = ['blt_tabset_tab'.freeze, TkUtil.untrust('00000')]).instance_eval{
17
+ (TabsetTab_ID = ['blt_tabset_tab'.freeze, '00000']).instance_eval{
18
18
  @mutex = Mutex.new
19
19
  def mutex; @mutex; end
20
20
  freeze
@@ -97,30 +97,22 @@ module Tk::BLT
97
97
  end
98
98
  end
99
99
 
100
- #def bind(context, cmd=Proc.new, *args)
101
- # @t.tab_bind(@id, context, cmd, *args)
102
- # self
103
- #end
104
- def bind(context, *args)
100
+ def bind(context, *args, &block)
105
101
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
106
- if TkComm._callback_entry?(args[0]) || !block_given?
102
+ if TkComm._callback_entry?(args[0]) || !block
107
103
  cmd = args.shift
108
104
  else
109
- cmd = Proc.new
105
+ cmd = block
110
106
  end
111
107
  @t.tab_bind(@id, context, cmd, *args)
112
108
  self
113
109
  end
114
- #def bind_append(context, cmd=Proc.new, *args)
115
- # @t.tab_bind_append(@id, context, cmd, *args)
116
- # self
117
- #end
118
- def bind_append(context, *args)
110
+ def bind_append(context, *args, &block)
119
111
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
120
- if TkComm._callback_entry?(args[0]) || !block_given?
112
+ if TkComm._callback_entry?(args[0]) || !block
121
113
  cmd = args.shift
122
114
  else
123
- cmd = Proc.new
115
+ cmd = block
124
116
  end
125
117
  @t.tab_bind_append(@id, context, cmd, *args)
126
118
  self
@@ -289,30 +281,23 @@ module Tk::BLT
289
281
  end
290
282
  alias highlight activate
291
283
 
292
- #def tabbind(tag, context, cmd=Proc.new, *args)
293
- # _bind([path, "bind", tagid(tag)], context, cmd, *args)
294
- # self
295
- #end
296
- def tabbind(tag, context, *args)
284
+ def tabbind(tag, context, *args, &block)
297
285
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
298
- if TkComm._callback_entry?(args[0]) || !block_given?
286
+ if TkComm._callback_entry?(args[0]) || !block
299
287
  cmd = args.shift
300
288
  else
301
- cmd = Proc.new
289
+ cmd = block
302
290
  end
303
291
  _bind([path, "bind", tagid(tag)], context, cmd, *args)
304
292
  self
305
293
  end
306
- #def tabbind_append(tag, context, cmd=Proc.new, *args)
307
- # _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
308
- # self
309
- #end
310
- def tabbind_append(tag, context, *args)
294
+
295
+ def tabbind_append(tag, context, *args, &block)
311
296
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
312
- if TkComm._callback_entry?(args[0]) || !block_given?
297
+ if TkComm._callback_entry?(args[0]) || !block
313
298
  cmd = args.shift
314
299
  else
315
- cmd = Proc.new
300
+ cmd = block
316
301
  end
317
302
  _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
318
303
  self
@@ -482,8 +467,8 @@ module Tk::BLT
482
467
  window(tk_send('tab', 'tearoff', tagindex(index), parent))
483
468
  end
484
469
 
485
- def xscrollcommand(cmd=Proc.new)
486
- configure_cmd 'scrollcommand', cmd
470
+ def xscrollcommand(cmd=nil, &block)
471
+ configure_cmd('scrollcommand', cmd || block)
487
472
  self
488
473
  end
489
474
  alias scrollcommand xscrollcommand
@@ -273,7 +273,7 @@ module Tk::BLT
273
273
  TreeTagID_TBL.mutex.synchronize{ TreeTagID_TBL.clear }
274
274
  }
275
275
 
276
- (TreeTag_ID = ['blt_tree_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
276
+ (TreeTag_ID = ['blt_tree_tag'.freeze, '00000']).instance_eval{
277
277
  @mutex = Mutex.new
278
278
  def mutex; @mutex; end
279
279
  freeze
@@ -431,7 +431,7 @@ module Tk::BLT
431
431
  elsif TkComm._callback_entry?(args[-1])
432
432
  cmd = args.pop
433
433
  elsif b
434
- cmd = Proc.new(&b)
434
+ cmd = b
435
435
  else
436
436
  fail ArgumentError, "lack of 'command' argument"
437
437
  end
@@ -536,7 +536,7 @@ module Tk::BLT
536
536
 
537
537
  if !cmd
538
538
  if b
539
- cmd = Proc.new(&b)
539
+ cmd = b
540
540
  else
541
541
  fail ArgumentError, "lack of 'command' argument"
542
542
  end
@@ -579,7 +579,7 @@ module Tk::BLT
579
579
 
580
580
  TreeID_TBL = TkCore::INTERP.create_table
581
581
 
582
- (Tree_ID = ['blt_tree'.freeze, TkUtil.untrust('00000')]).instance_eval{
582
+ (Tree_ID = ['blt_tree'.freeze, '00000']).instance_eval{
583
583
  @mutex = Mutex.new
584
584
  def mutex; @mutex; end
585
585
  freeze
@@ -601,7 +601,7 @@ module Tk::BLT
601
601
 
602
602
  # sort command
603
603
  'ascii'=>nil, 'decreasing'=>nil, 'dictionary'=>nil,
604
- 'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil,
604
+ 'integer'=>nil, 'real'=>nil, 'reorder'=>nil,
605
605
  }
606
606
  end
607
607
 
@@ -367,20 +367,20 @@ class Tk::BLT::Treeview
367
367
  list(tk_send('bbox', '-screen', *(tags.collect{|tag| tagid(tag)})))
368
368
  end
369
369
 
370
- def tag_bind(tag, seq, *args)
371
- if TkComm._callback_entry?(args[0]) || !block_given?
370
+ def tag_bind(tag, seq, *args, &block)
371
+ if TkComm._callback_entry?(args[0]) || !block
372
372
  cmd = args.shift
373
373
  else
374
- cmd = Proc.new
374
+ cmd = block
375
375
  end
376
376
  _bind([@path, 'bind', tagid(tag)], seq, cmd, *args)
377
377
  self
378
378
  end
379
- def tag_bind_append(tag, seq, *args)
380
- if TkComm._callback_entry?(args[0]) || !block_given?
379
+ def tag_bind_append(tag, seq, *args, &block)
380
+ if TkComm._callback_entry?(args[0]) || !block
381
381
  cmd = args.shift
382
382
  else
383
- cmd = Proc.new
383
+ cmd = block
384
384
  end
385
385
  _bind_append([@path, 'bind', tagid(tag)], seq, cmd, *args)
386
386
  self
@@ -398,20 +398,20 @@ class Tk::BLT::Treeview
398
398
  self
399
399
  end
400
400
 
401
- def button_bind(tag, seq, *args)
402
- if TkComm._callback_entry?(args[0]) || !block_given?
401
+ def button_bind(tag, seq, *args, &block)
402
+ if TkComm._callback_entry?(args[0]) || !block
403
403
  cmd = args.shift
404
404
  else
405
- cmd = Proc.new
405
+ cmd = block
406
406
  end
407
407
  _bind([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
408
408
  self
409
409
  end
410
- def button_bind_append(tag, seq, *args)
411
- if TkComm._callback_entry?(args[0]) || !block_given?
410
+ def button_bind_append(tag, seq, *args, &block)
411
+ if TkComm._callback_entry?(args[0]) || !block
412
412
  cmd = args.shift
413
413
  else
414
- cmd = Proc.new
414
+ cmd = block
415
415
  end
416
416
  _bind_append([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
417
417
  self
@@ -1045,7 +1045,7 @@ class Tk::BLT::Treeview::Node < TkObject
1045
1045
 
1046
1046
  TreeNodeID_TBL = TkCore::INTERP.create_table
1047
1047
 
1048
- (TreeNode_ID = ['blt_treeview_node'.freeze, TkUtil.untrust('00000')]).instance_eval{
1048
+ (TreeNode_ID = ['blt_treeview_node'.freeze, '00000']).instance_eval{
1049
1049
  @mutex = Mutex.new
1050
1050
  def mutex; @mutex; end
1051
1051
  freeze
@@ -1166,7 +1166,7 @@ class Tk::BLT::Treeview::Tag < TkObject
1166
1166
 
1167
1167
  TreeTagID_TBL = TkCore::INTERP.create_table
1168
1168
 
1169
- (TreeTag_ID = ['blt_treeview_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
1169
+ (TreeTag_ID = ['blt_treeview_tag'.freeze, '00000']).instance_eval{
1170
1170
  @mutex = Mutex.new
1171
1171
  def mutex; @mutex; end
1172
1172
  freeze
@@ -15,7 +15,7 @@ module Tk::BLT
15
15
 
16
16
  WATCH_ID_TBL = TkCore::INTERP.create_table
17
17
 
18
- (BLT_WATCH_ID = ['blt_watch_id'.freeze, TkUtil.untrust('00000')]).instance_eval{
18
+ (BLT_WATCH_ID = ['blt_watch_id'.freeze, '00000']).instance_eval{
19
19
  @mutex = Mutex.new
20
20
  def mutex; @mutex; end
21
21
  freeze
@@ -39,31 +39,23 @@ class Tk::BWidget::LabelEntry
39
39
  end
40
40
  private :__font_optkeys
41
41
 
42
- #def entrybind(*args)
43
- # _bind([path, 'bind'], *args)
44
- # self
45
- #end
46
- def entrybind(context, *args)
42
+ def entrybind(context, *args, &block)
47
43
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
48
- if TkComm._callback_entry?(args[0]) || !block_given?
44
+ if TkComm._callback_entry?(args[0]) || !block
49
45
  cmd = args.shift
50
46
  else
51
- cmd = Proc.new
47
+ cmd = block
52
48
  end
53
49
  _bind([path, 'bind'], context, cmd, *args)
54
50
  self
55
51
  end
56
52
 
57
- #def entrybind_append(*args)
58
- # _bind_append([path, 'bind'], *args)
59
- # self
60
- #end
61
- def entrybind_append(context, *args)
53
+ def entrybind_append(context, *args, &block)
62
54
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
63
- if TkComm._callback_entry?(args[0]) || !block_given?
55
+ if TkComm._callback_entry?(args[0]) || !block
64
56
  cmd = args.shift
65
57
  else
66
- cmd = Proc.new
58
+ cmd = block
67
59
  end
68
60
  _bind_append([path, 'bind'], context, cmd, *args)
69
61
  self
@@ -50,32 +50,24 @@ class Tk::BWidget::ListBox
50
50
  end
51
51
  end
52
52
 
53
- #def imagebind(*args)
54
- # _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
55
- # self
56
- #end
57
- def imagebind(context, *args)
53
+ def imagebind(context, *args, &block)
58
54
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
59
- if TkComm._callback_entry?(args[0]) || !block_given?
55
+ if TkComm._callback_entry?(args[0]) || !block
60
56
  cmd = args.shift
61
57
  else
62
- cmd = Proc.new
58
+ cmd = block
63
59
  end
64
60
  _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
65
61
  context, cmd, *args)
66
62
  self
67
63
  end
68
64
 
69
- #def imagebind_append(*args)
70
- # _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
71
- # self
72
- #end
73
- def imagebind_append(context, *args)
65
+ def imagebind_append(context, *args, &block)
74
66
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
75
- if TkComm._callback_entry?(args[0]) || !block_given?
67
+ if TkComm._callback_entry?(args[0]) || !block
76
68
  cmd = args.shift
77
69
  else
78
- cmd = Proc.new
70
+ cmd = block
79
71
  end
80
72
  _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
81
73
  context, cmd, *args)
@@ -91,32 +83,24 @@ class Tk::BWidget::ListBox
91
83
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
92
84
  end
93
85
 
94
- #def textbind(*args)
95
- # _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args)
96
- # self
97
- #end
98
- def textbind(context, *args)
86
+ def textbind(context, *args, &block)
99
87
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
100
- if TkComm._callback_entry?(args[0]) || !block_given?
88
+ if TkComm._callback_entry?(args[0]) || !block
101
89
  cmd = args.shift
102
90
  else
103
- cmd = Proc.new
91
+ cmd = block
104
92
  end
105
93
  _bind_for_event_class(Event_for_Items, [path, 'bindText'],
106
94
  context, cmd, *args)
107
95
  self
108
96
  end
109
97
 
110
- #def textbind_append(*args)
111
- # _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args)
112
- # self
113
- #end
114
- def textbind_append(context, *args)
98
+ def textbind_append(context, *args, &block)
115
99
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
116
- if TkComm._callback_entry?(args[0]) || !block_given?
100
+ if TkComm._callback_entry?(args[0]) || !block
117
101
  cmd = args.shift
118
102
  else
119
- cmd = Proc.new
103
+ cmd = block
120
104
  end
121
105
  _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
122
106
  context, cmd, *args)
@@ -213,7 +197,7 @@ class Tk::BWidget::ListBox::Item
213
197
 
214
198
  ListItem_TBL = TkCore::INTERP.create_table
215
199
 
216
- (ListItem_ID = ['bw:item'.freeze, TkUtil.untrust('00000')]).instance_eval{
200
+ (ListItem_ID = ['bw:item'.freeze, '00000']).instance_eval{
217
201
  @mutex = Mutex.new
218
202
  def mutex; @mutex; end
219
203
  freeze
@@ -47,32 +47,24 @@ class Tk::BWidget::NoteBook
47
47
  end
48
48
  end
49
49
 
50
- #def tabbind(*args)
51
- # _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'], *args)
52
- # self
53
- #end
54
- def tabbind(context, *args)
50
+ def tabbind(context, *args, &block)
55
51
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
56
- if TkComm._callback_entry?(args[0]) || !block_given?
52
+ if TkComm._callback_entry?(args[0]) || !block
57
53
  cmd = args.shift
58
54
  else
59
- cmd = Proc.new
55
+ cmd = block
60
56
  end
61
57
  _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
62
58
  context, cmd, *args)
63
59
  self
64
60
  end
65
61
 
66
- #def tabbind_append(*args)
67
- # _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'], *args)
68
- # self
69
- #end
70
- def tabbind_append(context, *args)
62
+ def tabbind_append(context, *args, &block)
71
63
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
72
- if TkComm._callback_entry?(args[0]) || !block_given?
64
+ if TkComm._callback_entry?(args[0]) || !block
73
65
  cmd = args.shift
74
66
  else
75
- cmd = Proc.new
67
+ cmd = block
76
68
  end
77
69
  _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
78
70
  context, cmd, *args)
@@ -43,31 +43,23 @@ class Tk::BWidget::SpinBox
43
43
  end
44
44
  private :__tkvariable_optkeys
45
45
 
46
- #def entrybind(*args)
47
- # _bind([path, 'bind'], *args)
48
- # self
49
- #end
50
- def entrybind(context, *args)
46
+ def entrybind(context, *args, &block)
51
47
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
52
- if TkComm._callback_entry?(args[0]) || !block_given?
48
+ if TkComm._callback_entry?(args[0]) || !block
53
49
  cmd = args.shift
54
50
  else
55
- cmd = Proc.new
51
+ cmd = block
56
52
  end
57
53
  _bind([path, 'bind'], context, cmd, *args)
58
54
  self
59
55
  end
60
56
 
61
- #def entrybind_append(*args)
62
- # _bind_append([path, 'bind'], *args)
63
- # self
64
- #end
65
- def entrybind_append(context, *args)
57
+ def entrybind_append(context, *args, &block)
66
58
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
67
- if TkComm._callback_entry?(args[0]) || !block_given?
59
+ if TkComm._callback_entry?(args[0]) || !block
68
60
  cmd = args.shift
69
61
  else
70
- cmd = Proc.new
62
+ cmd = block
71
63
  end
72
64
  _bind_append([path, 'bind'], context, cmd, *args)
73
65
  self
@@ -58,22 +58,22 @@ class Tk::BWidget::Tree
58
58
  end
59
59
  end
60
60
 
61
- def areabind(context, *args)
62
- if TkComm._callback_entry?(args[0]) || !block_given?
61
+ def areabind(context, *args, &block)
62
+ if TkComm._callback_entry?(args[0]) || !block
63
63
  cmd = args.shift
64
64
  else
65
- cmd = Proc.new
65
+ cmd = block
66
66
  end
67
67
  _bind_for_event_class(Event_for_Items, [path, 'bindArea'],
68
68
  context, cmd, *args)
69
69
  self
70
70
  end
71
71
 
72
- def areabind_append(context, *args)
73
- if TkComm._callback_entry?(args[0]) || !block_given?
72
+ def areabind_append(context, *args, &block)
73
+ if TkComm._callback_entry?(args[0]) || !block
74
74
  cmd = args.shift
75
75
  else
76
- cmd = Proc.new
76
+ cmd = block
77
77
  end
78
78
  _bind_append_for_event_class(Event_for_Items, [path, 'bindArea'],
79
79
  context, cmd, *args)
@@ -89,32 +89,24 @@ class Tk::BWidget::Tree
89
89
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
90
90
  end
91
91
 
92
- #def imagebind(*args)
93
- # _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
94
- # self
95
- #end
96
- def imagebind(context, *args)
92
+ def imagebind(context, *args, &block)
97
93
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
98
- if TkComm._callback_entry?(args[0]) || !block_given?
94
+ if TkComm._callback_entry?(args[0]) || !block
99
95
  cmd = args.shift
100
96
  else
101
- cmd = Proc.new
97
+ cmd = block
102
98
  end
103
99
  _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
104
100
  context, cmd, *args)
105
101
  self
106
102
  end
107
103
 
108
- #def imagebind_append(*args)
109
- # _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
110
- # self
111
- #end
112
- def imagebind_append(context, *args)
104
+ def imagebind_append(context, *args, &block)
113
105
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
114
- if TkComm._callback_entry?(args[0]) || !block_given?
106
+ if TkComm._callback_entry?(args[0]) || !block
115
107
  cmd = args.shift
116
108
  else
117
- cmd = Proc.new
109
+ cmd = block
118
110
  end
119
111
  _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
120
112
  context, cmd, *args)
@@ -130,32 +122,24 @@ class Tk::BWidget::Tree
130
122
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
131
123
  end
132
124
 
133
- #def textbind(*args)
134
- # _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args)
135
- # self
136
- #end
137
- def textbind(context, *args)
125
+ def textbind(context, *args, &block)
138
126
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
139
- if TkComm._callback_entry?(args[0]) || !block_given?
127
+ if TkComm._callback_entry?(args[0]) || !block
140
128
  cmd = args.shift
141
129
  else
142
- cmd = Proc.new
130
+ cmd = block
143
131
  end
144
132
  _bind_for_event_class(Event_for_Items, [path, 'bindText'],
145
133
  context, cmd, *args)
146
134
  self
147
135
  end
148
136
 
149
- #def textbind_append(*args)
150
- # _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args)
151
- # self
152
- #end
153
- def textbind_append(context, *args)
137
+ def textbind_append(context, *args, &block)
154
138
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
155
- if TkComm._callback_entry?(args[0]) || !block_given?
139
+ if TkComm._callback_entry?(args[0]) || !block
156
140
  cmd = args.shift
157
141
  else
158
- cmd = Proc.new
142
+ cmd = block
159
143
  end
160
144
  _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
161
145
  context, cmd, *args)
@@ -310,7 +294,7 @@ class Tk::BWidget::Tree::Node
310
294
 
311
295
  TreeNode_TBL = TkCore::INTERP.create_table
312
296
 
313
- (TreeNode_ID = ['bw:node'.freeze, TkUtil.untrust('00000')]).instance_eval{
297
+ (TreeNode_ID = ['bw:node'.freeze, '00000']).instance_eval{
314
298
  @mutex = Mutex.new
315
299
  def mutex; @mutex; end
316
300
  freeze