tk 0.2.0 → 0.3.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 (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
@@ -12,13 +12,13 @@ class TkTimer
12
12
 
13
13
  TkCommandNames = ['after'.freeze].freeze
14
14
 
15
- (Tk_CBID = ['a'.freeze, TkUtil.untrust('00000')]).instance_eval{
15
+ (Tk_CBID = ['a'.freeze, '00000']).instance_eval{
16
16
  @mutex = Mutex.new
17
17
  def mutex; @mutex; end
18
18
  freeze
19
19
  }
20
20
 
21
- Tk_CBTBL = TkUtil.untrust({})
21
+ Tk_CBTBL = {}
22
22
 
23
23
  TkCore::INTERP.add_tk_procs('rb_after', 'id', <<-'EOL')
24
24
  if {[set st [catch {eval {ruby_cmd TkTimer callback} $id} ret]] != 0} {
@@ -17,48 +17,48 @@ module Tk::Mac
17
17
  extend TkCore
18
18
 
19
19
  # event handler callbacks
20
- def self.def_ShowPreferences(cmd=Proc.new)
21
- ip_eval("proc ::tk::mac::ShowPreferences {} { #{install_cmd(cmd)} }")
20
+ def self.def_ShowPreferences(cmd=nil, &block)
21
+ ip_eval("proc ::tk::mac::ShowPreferences {} { #{install_cmd(cmd || block)} }")
22
22
  nil
23
23
  end
24
24
 
25
- def self.def_OpenApplication(cmd=Proc.new)
26
- ip_eval("proc ::tk::mac::OpenApplication {} { #{install_cmd(cmd)} }")
25
+ def self.def_OpenApplication(cmd=nil, &block)
26
+ ip_eval("proc ::tk::mac::OpenApplication {} { #{install_cmd(cmd || block)} }")
27
27
  nil
28
28
  end
29
29
 
30
- def self.def_ReopenApplication(cmd=Proc.new)
31
- ip_eval("proc ::tk::mac::ReopenApplication {} { #{install_cmd(cmd)} }")
30
+ def self.def_ReopenApplication(cmd=nil, &block)
31
+ ip_eval("proc ::tk::mac::ReopenApplication {} { #{install_cmd(cmd || block)} }")
32
32
  nil
33
33
  end
34
34
 
35
- def self.def_OpenDocument(cmd=Proc.new)
36
- ip_eval("proc ::tk::mac::OpenDocument {args} { eval #{install_cmd(cmd)} $args }")
35
+ def self.def_OpenDocument(cmd=nil, &block)
36
+ ip_eval("proc ::tk::mac::OpenDocument {args} { eval #{install_cmd(cmd || block)} $args }")
37
37
  nil
38
38
  end
39
39
 
40
- def self.def_PrintDocument(cmd=Proc.new)
41
- ip_eval("proc ::tk::mac::PrintDocument {args} { eval #{install_cmd(cmd)} $args }")
40
+ def self.def_PrintDocument(cmd=nil, &block)
41
+ ip_eval("proc ::tk::mac::PrintDocument {args} { eval #{install_cmd(cmd || block)} $args }")
42
42
  nil
43
43
  end
44
44
 
45
- def self.def_Quit(cmd=Proc.new)
46
- ip_eval("proc ::tk::mac::Quit {} { #{install_cmd(cmd)} }")
45
+ def self.def_Quit(cmd=nil, &block)
46
+ ip_eval("proc ::tk::mac::Quit {} { #{install_cmd(cmd || block)} }")
47
47
  nil
48
48
  end
49
49
 
50
- def self.def_OnHide(cmd=Proc.new)
51
- ip_eval("proc ::tk::mac::OnHide {} { #{install_cmd(cmd)} }")
50
+ def self.def_OnHide(cmd=nil, &block)
51
+ ip_eval("proc ::tk::mac::OnHide {} { #{install_cmd(cmd || block)} }")
52
52
  nil
53
53
  end
54
54
 
55
- def self.def_OnShow(cmd=Proc.new)
56
- ip_eval("proc ::tk::mac::OnShow {} { #{install_cmd(cmd)} }")
55
+ def self.def_OnShow(cmd=nil, &block)
56
+ ip_eval("proc ::tk::mac::OnShow {} { #{install_cmd(cmd || block)} }")
57
57
  nil
58
58
  end
59
59
 
60
- def self.def_ShowHelp(cmd=Proc.new)
61
- ip_eval("proc ::tk::mac::ShowHelp {} { #{install_cmd(cmd)} }")
60
+ def self.def_ShowHelp(cmd=nil, &block)
61
+ ip_eval("proc ::tk::mac::ShowHelp {} { #{install_cmd(cmd || block)} }")
62
62
  nil
63
63
  end
64
64
 
@@ -294,7 +294,8 @@ class TkValidateCommand
294
294
  ['vcmd', 'validatecommand', 'invcmd', 'invalidcommand']
295
295
  end
296
296
 
297
- def _initialize_for_cb_class(klass, cmd = Proc.new, *args)
297
+ def _initialize_for_cb_class(klass, cmd = nil, *args, &block)
298
+ cmd ||= block
298
299
  extra_args_tbl = klass._get_extra_args_tbl
299
300
 
300
301
  if args.compact.size > 0
@@ -332,8 +333,8 @@ class TkValidateCommand
332
333
  end
333
334
  end
334
335
 
335
- def initialize(cmd = Proc.new, *args)
336
- _initialize_for_cb_class(self.class::ValidateArgs, cmd, *args)
336
+ def initialize(cmd = nil, *args, &block)
337
+ _initialize_for_cb_class(self.class::ValidateArgs, cmd || block, *args)
337
338
  end
338
339
 
339
340
  def to_eval
@@ -363,36 +364,4 @@ module TkValidation
363
364
  end
364
365
 
365
366
  Tk::ValidateConfigure.__def_validcmd(binding, ValidateCmd)
366
-
367
- =begin
368
- def validatecommand(cmd = Proc.new, args = nil)
369
- if cmd.kind_of?(ValidateCmd)
370
- configure('validatecommand', cmd)
371
- elsif args
372
- configure('validatecommand', [cmd, args])
373
- else
374
- configure('validatecommand', cmd)
375
- end
376
- end
377
- =end
378
- # def validatecommand(*args, &b)
379
- # __validcmd_call(ValidateCmd, 'validatecommand', *args, &b)
380
- # end
381
- # alias vcmd validatecommand
382
-
383
- =begin
384
- def invalidcommand(cmd = Proc.new, args = nil)
385
- if cmd.kind_of?(ValidateCmd)
386
- configure('invalidcommand', cmd)
387
- elsif args
388
- configure('invalidcommand', [cmd, args])
389
- else
390
- configure('invalidcommand', cmd)
391
- end
392
- end
393
- =end
394
- # def invalidcommand(*args, &b)
395
- # __validcmd_call(ValidateCmd, 'invalidcommand', *args, &b)
396
- # end
397
- # alias invcmd invalidcommand
398
367
  end
@@ -17,7 +17,7 @@ class TkVariable
17
17
  #TkVar_ID_TBL = {}
18
18
  TkVar_CB_TBL = TkCore::INTERP.create_table
19
19
  TkVar_ID_TBL = TkCore::INTERP.create_table
20
- (Tk_VARIABLE_ID = ["v".freeze, TkUtil.untrust("00000")]).instance_eval{
20
+ (Tk_VARIABLE_ID = ["v".freeze, "00000"]).instance_eval{
21
21
  @mutex = Mutex.new
22
22
  def mutex; @mutex; end
23
23
  freeze
@@ -131,9 +131,9 @@ class TkVariable
131
131
  self
132
132
  end
133
133
  alias default_value= set_default_value
134
- def default_proc(cmd = Proc.new)
134
+ def default_proc(cmd = nil, &block)
135
135
  @def_default = :proc
136
- @default_val = cmd
136
+ @default_val = cmd || block
137
137
  self
138
138
  end
139
139
 
@@ -1372,7 +1372,8 @@ end
1372
1372
  end
1373
1373
  private :_check_trace_opt
1374
1374
 
1375
- def trace(opts, cmd = Proc.new)
1375
+ def trace(opts, cmd = nil, &block)
1376
+ cmd ||= block
1376
1377
  opts = _check_trace_opt(opts)
1377
1378
  (@trace_var ||= []).unshift([opts,cmd])
1378
1379
 
@@ -1412,7 +1413,8 @@ end
1412
1413
  self
1413
1414
  end
1414
1415
 
1415
- def trace_element(elem, opts, cmd = Proc.new)
1416
+ def trace_element(elem, opts, cmd = nil, &block)
1417
+ cmd ||= block
1416
1418
  if @elem
1417
1419
  fail(RuntimeError,
1418
1420
  "invalid for a TkVariable which denotes an element of Tcl's array")
@@ -10,7 +10,7 @@ class TkVirtualEvent<TkObject
10
10
 
11
11
  TkCommandNames = ['event'.freeze].freeze
12
12
 
13
- (TkVirtualEventID = ["VirtEvent".freeze, TkUtil.untrust("00000")]).instance_eval{
13
+ (TkVirtualEventID = ["VirtEvent".freeze, "00000"]).instance_eval{
14
14
  @mutex = Mutex.new
15
15
  def mutex; @mutex; end
16
16
  freeze
@@ -33,23 +33,6 @@ module Tk::BLT
33
33
  end
34
34
  private :__tkvariable_optkeys
35
35
 
36
- =begin
37
- BarElement_ID = ['blt_barchart_bar'.freeze, TkUtil.untrust('00000')].freeze
38
-
39
- def bar(elem=nil, keys={})
40
- if elem.kind_of?(Hash)
41
- keys = elem
42
- elem = nil
43
- end
44
- unless elem
45
- elem = BarElement_ID.join(TkCore::INTERP._ip_id_).freeze
46
- BarElement_ID[1].succ!
47
- end
48
- tk_send('bar', elem, keys)
49
- Element.new(self, elem, :without_creating=>true)
50
- end
51
- =end
52
-
53
36
  def extents(item)
54
37
  num_or_str(tk_send_without_enc('extents', item))
55
38
  end
@@ -15,7 +15,7 @@ module Tk::BLT
15
15
 
16
16
  BITMAP_ID_TBL = TkCore::INTERP.create_table
17
17
 
18
- (BITMAP_ID = ['blt_bitmap_id'.freeze, TkUtil.untrust('00000')]).instance_eval{
18
+ (BITMAP_ID = ['blt_bitmap_id'.freeze, '00000']).instance_eval{
19
19
  @mutex = Mutex.new
20
20
  def mutex; @mutex; end
21
21
  freeze
@@ -414,7 +414,7 @@ module Tk::BLT
414
414
  #################
415
415
 
416
416
  class Axis < TkObject
417
- (OBJ_ID = ['blt_chart_axis'.freeze, TkUtil.untrust('00000')]).instance_eval{
417
+ (OBJ_ID = ['blt_chart_axis'.freeze, '00000']).instance_eval{
418
418
  @mutex = Mutex.new
419
419
  def mutex; @mutex; end
420
420
  freeze
@@ -536,7 +536,7 @@ module Tk::BLT
536
536
  if cmd
537
537
  configure('command', cmd)
538
538
  elsif b
539
- configure('command', Proc.new(&b))
539
+ configure('command', b)
540
540
  else
541
541
  cget('command')
542
542
  end
@@ -672,7 +672,7 @@ module Tk::BLT
672
672
  ElementID_TBL.mutex.synchronize{ ElementID_TBL.clear }
673
673
  }
674
674
 
675
- (OBJ_ID = ['blt_chart_element'.freeze, TkUtil.untrust('00000')]).instance_eval{
675
+ (OBJ_ID = ['blt_chart_element'.freeze, '00000']).instance_eval{
676
676
  @mutex = Mutex.new
677
677
  def mutex; @mutex; end
678
678
  freeze
@@ -991,7 +991,7 @@ module Tk::BLT
991
991
  #################
992
992
 
993
993
  class Pen < TkObject
994
- (OBJ_ID = ['blt_chart_pen'.freeze, TkUtil.untrust('00000')]).instance_eval{
994
+ (OBJ_ID = ['blt_chart_pen'.freeze, '00000']).instance_eval{
995
995
  @mutex = Mutex.new
996
996
  def mutex; @mutex; end
997
997
  freeze
@@ -1425,20 +1425,20 @@ module Tk::BLT
1425
1425
  end
1426
1426
  end
1427
1427
 
1428
- def _component_bind(target, tag, context, *args)
1429
- if TkComm._callback_entry?(args[0]) || !block_given?
1428
+ def _component_bind(target, tag, context, *args, &block)
1429
+ if TkComm._callback_entry?(args[0]) || !block
1430
1430
  cmd = args.shift
1431
1431
  else
1432
- cmd = Proc.new
1432
+ cmd = block
1433
1433
  end
1434
1434
  _bind([path, target, 'bind', tagid(tag)], context, cmd, *args)
1435
1435
  self
1436
1436
  end
1437
- def _component_bind_append(target, tag, context, *args)
1438
- if TkComm._callback_entry?(args[0]) || !block_given?
1437
+ def _component_bind_append(target, tag, context, *args, &block)
1438
+ if TkComm._callback_entry?(args[0]) || !block
1439
1439
  cmd = args.shift
1440
1440
  else
1441
- cmd = Proc.new
1441
+ cmd = block
1442
1442
  end
1443
1443
  _bind_append([path, target, 'bind', tagid(tag)], context, cmd, *args)
1444
1444
  self
@@ -1947,20 +1947,20 @@ module Tk::BLT
1947
1947
  def current_xaxis_configinfo(slot=nil)
1948
1948
  current_itemconfiginfo('xaxis', slot)
1949
1949
  end
1950
- def xaxis_bind(context, *args)
1951
- if TkComm._callback_entry?(args[0]) || !block_given?
1950
+ def xaxis_bind(context, *args, &block)
1951
+ if TkComm._callback_entry?(args[0]) || !block
1952
1952
  cmd = args.shift
1953
1953
  else
1954
- cmd = Proc.new
1954
+ cmd = block
1955
1955
  end
1956
1956
  _bind([path, 'xaxis', 'bind'], context, cmd, *args)
1957
1957
  self
1958
1958
  end
1959
- def xaxis_bind_append(context, *args)
1960
- if TkComm._callback_entry?(args[0]) || !block_given?
1959
+ def xaxis_bind_append(context, *args, &block)
1960
+ if TkComm._callback_entry?(args[0]) || !block
1961
1961
  cmd = args.shift
1962
1962
  else
1963
- cmd = Proc.new
1963
+ cmd = block
1964
1964
  end
1965
1965
  _bind_append([path, 'xaxis', 'bind'], context, cmd, *args)
1966
1966
  self
@@ -2022,20 +2022,20 @@ module Tk::BLT
2022
2022
  def current_x2axis_configinfo(slot=nil)
2023
2023
  current_itemconfiginfo('x2axis', slot)
2024
2024
  end
2025
- def x2axis_bind(context, *args)
2026
- if TkComm._callback_entry?(args[0]) || !block_given?
2025
+ def x2axis_bind(context, *args, &block)
2026
+ if TkComm._callback_entry?(args[0]) || !block
2027
2027
  cmd = args.shift
2028
2028
  else
2029
- cmd = Proc.new
2029
+ cmd = block
2030
2030
  end
2031
2031
  _bind([path, 'x2axis', 'bind'], context, cmd, *args)
2032
2032
  self
2033
2033
  end
2034
- def x2axis_bind_append(context, *args)
2035
- if TkComm._callback_entry?(args[0]) || !block_given?
2034
+ def x2axis_bind_append(context, *args, &block)
2035
+ if TkComm._callback_entry?(args[0]) || !block
2036
2036
  cmd = args.shift
2037
2037
  else
2038
- cmd = Proc.new
2038
+ cmd = block
2039
2039
  end
2040
2040
  _bind_append([path, 'x2axis', 'bind'], context, cmd, *args)
2041
2041
  self
@@ -2097,20 +2097,20 @@ module Tk::BLT
2097
2097
  def current_yaxis_configinfo(slot=nil)
2098
2098
  current_itemconfiginfo('yaxis', slot)
2099
2099
  end
2100
- def yaxis_bind(context, *args)
2101
- if TkComm._callback_entry?(args[0]) || !block_given?
2100
+ def yaxis_bind(context, *args, &block)
2101
+ if TkComm._callback_entry?(args[0]) || !block
2102
2102
  cmd = args.shift
2103
2103
  else
2104
- cmd = Proc.new
2104
+ cmd = block
2105
2105
  end
2106
2106
  _bind([path, 'yaxis', 'bind'], context, cmd, *args)
2107
2107
  self
2108
2108
  end
2109
- def yaxis_bind_append(context, *args)
2110
- if TkComm._callback_entry?(args[0]) || !block_given?
2109
+ def yaxis_bind_append(context, *args, &block)
2110
+ if TkComm._callback_entry?(args[0]) || !block
2111
2111
  cmd = args.shift
2112
2112
  else
2113
- cmd = Proc.new
2113
+ cmd = block
2114
2114
  end
2115
2115
  _bind_append([path, 'yaxis', 'bind'], context, cmd, *args)
2116
2116
  self
@@ -2172,20 +2172,20 @@ module Tk::BLT
2172
2172
  def current_y2axis_configinfo(slot=nil)
2173
2173
  current_itemconfiginfo('y2axis', slot)
2174
2174
  end
2175
- def y2axis_bind(context, *args)
2176
- if TkComm._callback_entry?(args[0]) || !block_given?
2175
+ def y2axis_bind(context, *args, &block)
2176
+ if TkComm._callback_entry?(args[0]) || !block
2177
2177
  cmd = args.shift
2178
2178
  else
2179
- cmd = Proc.new
2179
+ cmd = block
2180
2180
  end
2181
2181
  _bind([path, 'y2axis', 'bind'], context, cmd, *args)
2182
2182
  self
2183
2183
  end
2184
- def y2axis_bind_append(context, *args)
2185
- if TkComm._callback_entry?(args[0]) || !block_given?
2184
+ def y2axis_bind_append(context, *args, &block)
2185
+ if TkComm._callback_entry?(args[0]) || !block
2186
2186
  cmd = args.shift
2187
2187
  else
2188
- cmd = Proc.new
2188
+ cmd = block
2189
2189
  end
2190
2190
  _bind_append([path, 'y2axis', 'bind'], context, cmd, *args)
2191
2191
  self
@@ -204,16 +204,16 @@ module Tk::BLT
204
204
  _setup_subst_table(KEY_TBL, PROC_TBL)
205
205
  end
206
206
 
207
- def self.source_handler(win, datatype, cmd=Proc.new, *args)
207
+ def self.source_handler(win, datatype, cmd=nil, *args, &block)
208
208
  _bind_for_event_class(DnD_Handle,
209
209
  ['::blt::drag&drop', 'source', win, 'handler'],
210
- cmd, *args)
210
+ cmd || block, *args)
211
211
  end
212
212
 
213
- def self.target_handler(win, datatype, cmd=Proc.new, *args)
213
+ def self.target_handler(win, datatype, cmd=nil, *args, &block)
214
214
  _bind_for_event_class(DnD_Handle,
215
215
  ['::blt::drag&drop', 'target', win, 'handler'],
216
- cmd, *args)
216
+ cmd || block, *args)
217
217
  end
218
218
 
219
219
  ###################################
@@ -255,8 +255,8 @@ module Tk::BLT
255
255
  tk_call('::blt::drag&drop', 'drop', win, x, y)
256
256
  end
257
257
 
258
- def self.errors(cmd=Proc.new)
259
- tk_call('::blt::drag&drop', 'errors', cmd)
258
+ def self.errors(cmd=nil, &block)
259
+ tk_call('::blt::drag&drop', 'errors', cmd || block)
260
260
  end
261
261
 
262
262
  def self.active
@@ -27,23 +27,6 @@ module Tk::BLT
27
27
  end
28
28
  private :__strval_optkeys
29
29
 
30
- =begin
31
- BarElement_ID = ['blt_graph_bar'.freeze, TkUtil.untrust('00000')].freeze
32
-
33
- def bar(elem=nil, keys={})
34
- if elem.kind_of?(Hash)
35
- keys = elem
36
- elem = nil
37
- end
38
- unless elem
39
- elem = BarElement_ID.join(TkCore::INTERP._ip_id_).freeze
40
- BarElement_ID[1].succ!
41
- end
42
- tk_send('bar', elem, keys)
43
- Element.new(self, elem, :without_creating=>true)
44
- end
45
- =end
46
-
47
30
  def extents(item)
48
31
  num_or_str(tk_send_without_enc('extents', item))
49
32
  end