tk 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cab0531a0a78cfd0e2b7f37cd8e510ec6f3f2b2c
4
- data.tar.gz: d4117436d70485d31d49ba811db3696eceb8fa9c
3
+ metadata.gz: 34d1ae2ebb5f28e7451783bcd7de572896cb6531
4
+ data.tar.gz: 4b06ce935ebdd67ce2cf4d006fa4d0f1ef4f7a15
5
5
  SHA512:
6
- metadata.gz: 523a4be78129d8d5084dd1d112a941c673c146cac1c756184e0f35e93decd7d70cc723db8bf0ab557740b38ff04b2049c1ede77e8f33e4ac44b92b5e63b2ddb8
7
- data.tar.gz: 7444c64545d5e0701f6e0f762296d4fb6cafd424ec99636c8fdc8516bc50dadad8f21c096eed5996dce10340ae01a5ece18ca109dd240ca3a41f2c5716f4faa9
6
+ metadata.gz: e463e532d49a88bb0d7a091f8d59f0f9583f06ba9202515a7757af98462ba5856a6b226d0b1e304fe2f2115851c52bd0dce0b09c1f3482a324ebbfdb6cc989d5
7
+ data.tar.gz: ce435a66235cbe0123474d374720d55d2a95a41c3d4f1825485af52631e52a5308e5fb4195fa93cb07707797c175d36360dd2f9634b09d57271af14c294780e1
data/README.md CHANGED
@@ -26,7 +26,16 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
26
26
 
27
27
  ## Contributing
28
28
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/tk.
29
+ Your contributions are welcome on GitHub at https://github.com/ruby/tk.
30
+
31
+ Unfortunately we have no resource to handle issue reports.
32
+
33
+ Therefore please open pull request with either:
34
+
35
+ - a bug report with a correction patch or
36
+ - (at least) a reproducible code snippet for an issue in form of a test/spec.
37
+
38
+ Thank you in advance!
30
39
 
31
40
  ## License
32
41
 
@@ -2441,7 +2441,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
2441
2441
  if (NIL_P(rb_errinfo())) {
2442
2442
  rb_exc_raise(rb_exc_new2(rb_eFatal, "FATAL"));
2443
2443
  } else {
2444
- rb_exc_raise(rb_errinfo());
2444
+ rb_jump_tag(TAG_FATAL);
2445
2445
  }
2446
2446
  }
2447
2447
  }
@@ -376,7 +376,7 @@ class RemoteTkIp
376
376
  end
377
377
 
378
378
  def _thread_vwait(var_name)
379
- _appsend(false, 'thread_vwait', varname)
379
+ _appsend(false, 'thread_vwait', var_name)
380
380
  end
381
381
 
382
382
  def _thread_tkwait(mode, target)
@@ -566,7 +566,7 @@ class Tk::Canvas<TkWindow
566
566
 
567
567
  def rchars(tag, first, last, str_or_coords)
568
568
  # Tcl/Tk 8.6 or later
569
- str_or_coords = str_or_coords.flatten if str_or_coords.kinad_of? Array
569
+ str_or_coords = str_or_coords.flatten if str_or_coords.kind_of? Array
570
570
  tk_send_without_enc('rchars', tagid(tag), first, last, str_or_coords)
571
571
  self
572
572
  end
@@ -923,13 +923,13 @@ module Tk::BLT
923
923
 
924
924
  def self.new(chart, keys={})
925
925
  obj = nil
926
- LegenedID_TBL.mutex.synchronize{
927
- unless (obj = LegenedID_TBL[chart.path])
926
+ LegendID_TBL.mutex.synchronize{
927
+ unless (obj = LegendID_TBL[chart.path])
928
928
  (obj = self.allocate).instance_eval{
929
929
  @parent = @chart = chart
930
930
  @cpath = @chart.path
931
931
  @path = @id = 'crosshairs'
932
- Legend::LegenedID_TBL[@cpath] = self
932
+ Legend::LegendID_TBL[@cpath] = self
933
933
  }
934
934
  end
935
935
  }
@@ -600,7 +600,7 @@ module Tk::BLT
600
600
  'recurse'=>nil, 'tags'=>nil,
601
601
 
602
602
  # sort command
603
- 'ascii'=>nil, 'decreasing'=>nil, 'disctionary'=>nil,
603
+ 'ascii'=>nil, 'decreasing'=>nil, 'dictionary'=>nil,
604
604
  'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil,
605
605
  }
606
606
  end
@@ -106,7 +106,7 @@ class Tk::Iwidgets::Tabset
106
106
  return
107
107
  end
108
108
 
109
- reutrn unless @canvas ||= self.winfo_children[0]
109
+ return unless @canvas ||= self.winfo_children[0]
110
110
 
111
111
  delta = 1 if (delta = cget(:gap)) == 'overlap' ||
112
112
  (delta = self.winfo_pixels(delta) + 1) <= 0
@@ -132,7 +132,7 @@ def check_pkg(file, verbose=false)
132
132
  unless ver.kind_of?(String)
133
133
  begin
134
134
  ver = TkPackage.require(name)
135
- sccess_list[name] = ver
135
+ success_list[name] = ver
136
136
  rescue
137
137
  end
138
138
  end
@@ -76,10 +76,10 @@ class << Tk::Tcllib::Crosshair
76
76
  private :itemcget_tkstring, :itemcget, :itemcget_strict
77
77
  private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
78
78
 
79
- def confugure(w, slot, value=None)
79
+ def configure(w, slot, value=None)
80
80
  itemconfigure(w, slot, value)
81
81
  end
82
- def confuginfo(w, slot = nil)
82
+ def configinfo(w, slot = nil)
83
83
  itemconfiginfo(w, slot)
84
84
  end
85
85
  def current_configinfo(w, slot = nil)
@@ -888,12 +888,12 @@ class Tk::Tcllib::Tablelist
888
888
  end
889
889
 
890
890
  def sortcolumn
891
- idx = num_or_str(tk_send('sortcolum'))
891
+ idx = num_or_str(tk_send('sortcolumn'))
892
892
  (idx.kind_of?(Fixnum) && idx < 0)? nil: idx
893
893
  end
894
894
 
895
895
  def sortcolumnlist
896
- simplelist(tk_send('sortcolumlist')).map{|col| num_or_str(col)}
896
+ simplelist(tk_send('sortcolumnlist')).map{|col| num_or_str(col)}
897
897
  end
898
898
 
899
899
  def sortorder
@@ -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
@@ -113,6 +160,14 @@ module Tk
113
160
  #end
114
161
  def dnd_bindtarget(type, event, *args)
115
162
  # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
163
+ klass = case type
164
+ when 'text/plain'
165
+ DND_SubstText
166
+ when 'text/uri-list'
167
+ DND_SubstFileList
168
+ else
169
+ DND_Subst
170
+ end
116
171
  if TkComm._callback_entry?(args[0]) || !block_given?
117
172
  cmd = args.shift
118
173
  else
@@ -125,11 +180,11 @@ module Tk
125
180
  event = tk_event_sequence(event)
126
181
  if prior.kind_of?(Numeric)
127
182
  tk_call('dnd', 'bindtarget', @path, type, event,
128
- install_bind_for_event_class(DND_Subst, cmd, *args),
183
+ install_bind_for_event_class(klass, cmd, *args),
129
184
  prior)
130
185
  else
131
186
  tk_call('dnd', 'bindtarget', @path, type, event,
132
- install_bind_for_event_class(DND_Subst, cmd, prior, *args))
187
+ install_bind_for_event_class(klass, cmd, prior, *args))
133
188
  end
134
189
  self
135
190
  end
data/tk.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "tk"
3
- spec.version = "0.1.1"
3
+ spec.version = "0.1.2"
4
4
  spec.authors = ["SHIBATA Hiroshi", "Nobuyoshi Nakada"]
5
5
  spec.email = ["hsbt@ruby-lang.org", "nobu@ruby-lang.org"]
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIBATA Hiroshi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-08-16 00:00:00.000000000 Z
12
+ date: 2017-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -1141,7 +1141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1141
1141
  version: '0'
1142
1142
  requirements: []
1143
1143
  rubyforge_project:
1144
- rubygems_version: 2.6.6
1144
+ rubygems_version: 2.6.10
1145
1145
  signing_key:
1146
1146
  specification_version: 4
1147
1147
  summary: Tk interface module using tcltklib.