ffi-tk 2010.08.23 → 2018.02.20
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 +7 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +371 -0
- data/AUTHORS +4 -2
- data/CHANGELOG +302 -262
- data/Gemfile +10 -0
- data/Gemfile.lock +45 -0
- data/MANIFEST +6 -6
- data/README.md +1 -1
- data/Rakefile +12 -11
- data/bin/rwish +6 -5
- data/example/choose_color.rb +5 -4
- data/example/choose_directory.rb +5 -4
- data/example/dialog.rb +9 -8
- data/example/hello.rb +2 -1
- data/example/message_box.rb +8 -5
- data/example/option_menu.rb +4 -3
- data/example/popup.rb +4 -3
- data/example/set_palette.rb +5 -4
- data/example/text.rb +30 -30
- data/example/tile/kroc_demo_small.rb +51 -55
- data/example/tile/kroc_rb_demo.rb +74 -83
- data/example/tile/notebook.rb +6 -9
- data/example/tile/theme_hello.rb +6 -8
- data/example/tile/themes.rb +4 -2
- data/example/tile/treeview.rb +16 -14
- data/example/tkgo.rb +120 -88
- data/example/various.rb +8 -7
- data/example/wait.rb +3 -2
- data/ffi-tk.gemspec +21 -20
- data/gemset.nix +134 -0
- data/lib/ffi-tk.rb +10 -11
- data/lib/ffi-tk/command.rb +3 -2
- data/lib/ffi-tk/command/after.rb +8 -7
- data/lib/ffi-tk/command/bell.rb +2 -1
- data/lib/ffi-tk/command/bind.rb +1 -0
- data/lib/ffi-tk/command/bindtags.rb +1 -0
- data/lib/ffi-tk/command/cget.rb +31 -24
- data/lib/ffi-tk/command/choose_color.rb +2 -1
- data/lib/ffi-tk/command/choose_directory.rb +2 -1
- data/lib/ffi-tk/command/clipboard.rb +6 -5
- data/lib/ffi-tk/command/configure.rb +23 -21
- data/lib/ffi-tk/command/destroy.rb +2 -1
- data/lib/ffi-tk/command/dialog.rb +4 -3
- data/lib/ffi-tk/command/event.rb +1 -0
- data/lib/ffi-tk/command/focus.rb +2 -1
- data/lib/ffi-tk/command/font.rb +12 -9
- data/lib/ffi-tk/command/get_open_file.rb +1 -0
- data/lib/ffi-tk/command/get_save_file.rb +1 -0
- data/lib/ffi-tk/command/grab.rb +2 -1
- data/lib/ffi-tk/command/grid.rb +7 -6
- data/lib/ffi-tk/command/image.rb +5 -4
- data/lib/ffi-tk/command/lower.rb +1 -0
- data/lib/ffi-tk/command/message_box.rb +2 -1
- data/lib/ffi-tk/command/option_menu.rb +3 -2
- data/lib/ffi-tk/command/pack.rb +5 -4
- data/lib/ffi-tk/command/place.rb +5 -4
- data/lib/ffi-tk/command/popup.rb +2 -1
- data/lib/ffi-tk/command/raise.rb +1 -0
- data/lib/ffi-tk/command/scrollable.rb +7 -10
- data/lib/ffi-tk/command/selection.rb +4 -3
- data/lib/ffi-tk/command/set_palette.rb +2 -1
- data/lib/ffi-tk/command/tk_cmd.rb +1 -0
- data/lib/ffi-tk/command/vars.rb +2 -1
- data/lib/ffi-tk/command/wait.rb +2 -1
- data/lib/ffi-tk/command/winfo.rb +9 -8
- data/lib/ffi-tk/command/wm.rb +11 -10
- data/lib/ffi-tk/core_extensions.rb +5 -4
- data/lib/ffi-tk/event/data.rb +32 -31
- data/lib/ffi-tk/event/handler.rb +4 -3
- data/lib/ffi-tk/ffi/tcl.rb +42 -31
- data/lib/ffi-tk/ffi/tcl/cmd_proc.rb +2 -1
- data/lib/ffi-tk/ffi/tcl/eval_result.rb +47 -8
- data/lib/ffi-tk/ffi/tcl/interp.rb +7 -4
- data/lib/ffi-tk/ffi/tcl/obj.rb +7 -32
- data/lib/ffi-tk/ffi/tcl/time.rb +2 -1
- data/lib/ffi-tk/ffi/tk.rb +8 -7
- data/lib/ffi-tk/geometry.rb +20 -17
- data/lib/ffi-tk/thread_sender.rb +1 -0
- data/lib/ffi-tk/tk.rb +23 -23
- data/lib/ffi-tk/variable.rb +25 -3
- data/lib/ffi-tk/version.rb +1 -1
- data/lib/ffi-tk/widget.rb +2 -1
- data/lib/ffi-tk/widget/button.rb +4 -1
- data/lib/ffi-tk/widget/canvas.rb +18 -15
- data/lib/ffi-tk/widget/canvas/arc.rb +2 -1
- data/lib/ffi-tk/widget/canvas/bitmap.rb +2 -1
- data/lib/ffi-tk/widget/canvas/image.rb +2 -1
- data/lib/ffi-tk/widget/canvas/item.rb +4 -4
- data/lib/ffi-tk/widget/canvas/line.rb +2 -1
- data/lib/ffi-tk/widget/canvas/oval.rb +2 -1
- data/lib/ffi-tk/widget/canvas/polygon.rb +2 -1
- data/lib/ffi-tk/widget/canvas/rectangle.rb +2 -1
- data/lib/ffi-tk/widget/canvas/text.rb +2 -1
- data/lib/ffi-tk/widget/canvas/window.rb +2 -1
- data/lib/ffi-tk/widget/checkbutton.rb +4 -1
- data/lib/ffi-tk/widget/entry.rb +4 -1
- data/lib/ffi-tk/widget/frame.rb +4 -1
- data/lib/ffi-tk/widget/label.rb +4 -1
- data/lib/ffi-tk/widget/labelframe.rb +4 -1
- data/lib/ffi-tk/widget/listbox.rb +5 -2
- data/lib/ffi-tk/widget/menu.rb +4 -1
- data/lib/ffi-tk/widget/menubutton.rb +4 -1
- data/lib/ffi-tk/widget/message.rb +4 -1
- data/lib/ffi-tk/widget/panedwindow.rb +5 -2
- data/lib/ffi-tk/widget/radiobutton.rb +4 -1
- data/lib/ffi-tk/widget/root.rb +1 -0
- data/lib/ffi-tk/widget/scale.rb +4 -1
- data/lib/ffi-tk/widget/scrollbar.rb +4 -1
- data/lib/ffi-tk/widget/spinbox.rb +4 -1
- data/lib/ffi-tk/widget/text.rb +20 -16
- data/lib/ffi-tk/widget/text/peer.rb +1 -0
- data/lib/ffi-tk/widget/tile.rb +2 -1
- data/lib/ffi-tk/widget/tile/button.rb +4 -1
- data/lib/ffi-tk/widget/tile/checkbutton.rb +4 -1
- data/lib/ffi-tk/widget/tile/combobox.rb +5 -2
- data/lib/ffi-tk/widget/tile/entry.rb +4 -1
- data/lib/ffi-tk/widget/tile/frame.rb +4 -1
- data/lib/ffi-tk/widget/tile/label.rb +4 -2
- data/lib/ffi-tk/widget/tile/labelframe.rb +4 -1
- data/lib/ffi-tk/widget/tile/menubutton.rb +4 -1
- data/lib/ffi-tk/widget/tile/notebook.rb +4 -1
- data/lib/ffi-tk/widget/tile/panedwindow.rb +4 -1
- data/lib/ffi-tk/widget/tile/progressbar.rb +4 -2
- data/lib/ffi-tk/widget/tile/radiobutton.rb +4 -1
- data/lib/ffi-tk/widget/tile/scale.rb +4 -1
- data/lib/ffi-tk/widget/tile/scrollbar.rb +7 -4
- data/lib/ffi-tk/widget/tile/separator.rb +4 -1
- data/lib/ffi-tk/widget/tile/sizegrip.rb +4 -1
- data/lib/ffi-tk/widget/tile/style.rb +16 -17
- data/lib/ffi-tk/widget/tile/treeview.rb +11 -5
- data/lib/ffi-tk/widget/toplevel.rb +4 -1
- data/shell.nix +19 -0
- data/spec/ffi-tk/command/bind.rb +5 -4
- data/spec/ffi-tk/command/bindtags.rb +2 -1
- data/spec/ffi-tk/command/clipboard.rb +4 -3
- data/spec/ffi-tk/command/font.rb +20 -19
- data/spec/ffi-tk/command/image.rb +13 -5
- data/spec/ffi-tk/command/pack.rb +3 -2
- data/spec/ffi-tk/command/place.rb +4 -3
- data/spec/ffi-tk/command/selection.rb +2 -1
- data/spec/ffi-tk/command/vars.rb +3 -2
- data/spec/ffi-tk/command/winfo.rb +10 -10
- data/spec/ffi-tk/command/wm.rb +23 -22
- data/spec/ffi-tk/event.rb +23 -21
- data/spec/ffi-tk/tile/button.rb +8 -8
- data/spec/ffi-tk/tile/checkbutton.rb +1 -1
- data/spec/ffi-tk/tile/combobox.rb +11 -12
- data/spec/ffi-tk/tile/entry.rb +18 -19
- data/spec/ffi-tk/tile/frame.rb +13 -13
- data/spec/ffi-tk/tile/label.rb +2 -2
- data/spec/ffi-tk/tile/labelframe.rb +1 -1
- data/spec/ffi-tk/tile/menubutton.rb +1 -1
- data/spec/ffi-tk/tile/notebook.rb +22 -20
- data/spec/ffi-tk/tile/panedwindow.rb +1 -1
- data/spec/ffi-tk/tile/progressbar.rb +1 -1
- data/spec/ffi-tk/tile/radiobutton.rb +1 -1
- data/spec/ffi-tk/tile/scale.rb +1 -1
- data/spec/ffi-tk/tile/scrollbar.rb +1 -16
- data/spec/ffi-tk/tile/separator.rb +2 -2
- data/spec/ffi-tk/tile/sizegrip.rb +1 -1
- data/spec/ffi-tk/tile/style.rb +63 -65
- data/spec/ffi-tk/tile/treeview.rb +11 -10
- data/spec/ffi-tk/variable.rb +5 -4
- data/spec/ffi-tk/widget/button.rb +3 -2
- data/spec/ffi-tk/widget/canvas.rb +59 -58
- data/spec/ffi-tk/widget/checkbutton.rb +6 -5
- data/spec/ffi-tk/widget/entry.rb +112 -103
- data/spec/ffi-tk/widget/frame.rb +2 -1
- data/spec/ffi-tk/widget/label.rb +2 -1
- data/spec/ffi-tk/widget/labelframe.rb +1 -0
- data/spec/ffi-tk/widget/listbox.rb +5 -4
- data/spec/ffi-tk/widget/menu.rb +3 -2
- data/spec/ffi-tk/widget/menubutton.rb +1 -0
- data/spec/ffi-tk/widget/message.rb +1 -0
- data/spec/ffi-tk/widget/panedwindow.rb +1 -0
- data/spec/ffi-tk/widget/radiobutton.rb +1 -0
- data/spec/ffi-tk/widget/root.rb +2 -1
- data/spec/ffi-tk/widget/scale.rb +1 -0
- data/spec/ffi-tk/widget/scrollbar.rb +1 -0
- data/spec/ffi-tk/widget/spinbox.rb +1 -0
- data/spec/ffi-tk/widget/text.rb +63 -54
- data/spec/ffi-tk/widget/toplevel.rb +1 -0
- data/spec/helper.rb +3 -1
- data/tasks/authors.rake +3 -2
- data/tasks/bacon.rake +13 -11
- data/tasks/changelog.rake +1 -0
- data/tasks/gem.rake +13 -11
- data/tasks/manifest.rake +2 -1
- data/tasks/release.rake +11 -32
- data/tasks/reversion.rake +2 -1
- metadata +52 -75
- data/spec/ffi-tk/command/grid.rb +0 -6
- data/tasks/gem_setup.rake +0 -113
- data/tasks/grancher.rake +0 -12
- data/tasks/rcov.rake +0 -17
- data/tasks/setup.rake +0 -12
- data/tasks/ycov.rake +0 -84
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Canvas
|
3
4
|
class Item < Struct.new(:canvas, :id)
|
@@ -52,9 +53,8 @@ module Tk
|
|
52
53
|
text: :string,
|
53
54
|
underline: :integer,
|
54
55
|
width: :integer,
|
55
|
-
width: :integer,
|
56
56
|
window: :pathname
|
57
|
-
}
|
57
|
+
}.freeze
|
58
58
|
|
59
59
|
def self.create(canvas, type, id)
|
60
60
|
klass = Canvas.const_get(type.to_s.capitalize)
|
@@ -79,7 +79,7 @@ end
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def inspect
|
82
|
-
|
82
|
+
'#<%s %d>' % [self.class.name, id]
|
83
83
|
end
|
84
84
|
|
85
85
|
def cget(option)
|
@@ -167,4 +167,4 @@ end
|
|
167
167
|
end
|
168
168
|
end
|
169
169
|
end
|
170
|
-
end
|
170
|
+
end
|
@@ -1,9 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
# Create and manipulate checkbutton widgets
|
3
4
|
class CheckButton < Button
|
4
5
|
include Cget, Configure
|
5
6
|
|
6
|
-
def self.tk_command
|
7
|
+
def self.tk_command
|
8
|
+
'checkbutton'
|
9
|
+
end
|
7
10
|
|
8
11
|
def initialize(parent = Tk.root, options = None)
|
9
12
|
if block_given?
|
data/lib/ffi-tk/widget/entry.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
# An entry is a widget that displays a one-line text string and allows that
|
3
4
|
# string to be edited using widget methods described below, which are
|
@@ -21,7 +22,9 @@ module Tk
|
|
21
22
|
class Entry < Widget
|
22
23
|
include Cget, Configure
|
23
24
|
|
24
|
-
def self.tk_command
|
25
|
+
def self.tk_command
|
26
|
+
'entry'
|
27
|
+
end
|
25
28
|
|
26
29
|
def value
|
27
30
|
get
|
data/lib/ffi-tk/widget/frame.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
# Create and manipulate frame widgets
|
3
4
|
# A frame is a simple widget.
|
@@ -7,6 +8,8 @@ module Tk
|
|
7
8
|
class Frame < Widget
|
8
9
|
include Cget, Configure
|
9
10
|
|
10
|
-
def self.tk_command
|
11
|
+
def self.tk_command
|
12
|
+
'frame'
|
13
|
+
end
|
11
14
|
end
|
12
15
|
end
|
data/lib/ffi-tk/widget/label.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
# A label is a widget that displays a textual string, bitmap or image.
|
3
4
|
#
|
@@ -13,7 +14,9 @@ module Tk
|
|
13
14
|
class Label < Widget
|
14
15
|
include Cget, Configure
|
15
16
|
|
16
|
-
def self.tk_command
|
17
|
+
def self.tk_command
|
18
|
+
'label'
|
19
|
+
end
|
17
20
|
|
18
21
|
def value=(string)
|
19
22
|
configure(text: string)
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Listbox < Widget
|
3
4
|
include Cget, Configure, Scrollable
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'listbox'
|
8
|
+
end
|
6
9
|
|
7
10
|
def clear
|
8
11
|
delete 0, :end
|
@@ -14,7 +17,7 @@ module Tk
|
|
14
17
|
|
15
18
|
def value=(enumerable)
|
16
19
|
clear
|
17
|
-
enumerable.each{|element| insert(:end, element) }
|
20
|
+
enumerable.each { |element| insert(:end, element) }
|
18
21
|
end
|
19
22
|
|
20
23
|
# Sets the active element to the one indicated by index.
|
data/lib/ffi-tk/widget/menu.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Menu < Widget
|
3
4
|
include Cget, Configure
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'menu'
|
8
|
+
end
|
6
9
|
|
7
10
|
# Change the state of the entry indicated by index to active and redisplay
|
8
11
|
# it using its active colors.
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
# Create and manipulate message widgets
|
3
4
|
#
|
@@ -31,6 +32,8 @@ module Tk
|
|
31
32
|
class Message < Widget
|
32
33
|
include Cget, Configure
|
33
34
|
|
34
|
-
def self.tk_command
|
35
|
+
def self.tk_command
|
36
|
+
'message'
|
37
|
+
end
|
35
38
|
end
|
36
39
|
end
|
@@ -1,15 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class PanedWindow < Widget
|
3
4
|
include Cget, Configure
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'panedwindow'
|
8
|
+
end
|
6
9
|
|
7
10
|
# Add one or more windows to the panedwindow, each in a separate pane.
|
8
11
|
# The arguments consist of the names of one or more windows followed by
|
9
12
|
# pairs of arguments that specify how to manage the windows.
|
10
13
|
# Option may have any of the values accepted by the configure subcommand.
|
11
14
|
def add(window, *arguments)
|
12
|
-
options, windows = arguments.partition{|arg| arg.respond_to?(:to_tcl_options) }
|
15
|
+
options, windows = arguments.partition { |arg| arg.respond_to?(:to_tcl_options) }
|
13
16
|
|
14
17
|
if option = options.first
|
15
18
|
execute(:add, window, *windows, option.to_tcl_options)
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class RadioButton < Button
|
3
4
|
include Cget, Configure
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'radiobutton'
|
8
|
+
end
|
6
9
|
|
7
10
|
# Deselects the radiobutton and sets the associated variable to an empty
|
8
11
|
# string. If this radiobutton was not currently selected, the command has
|
data/lib/ffi-tk/widget/root.rb
CHANGED
data/lib/ffi-tk/widget/scale.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Scale < Widget
|
3
4
|
include Cget, Configure
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'scale'
|
8
|
+
end
|
6
9
|
|
7
10
|
# Returns a list whose elements are the x and y coordinates of the point
|
8
11
|
# along the centerline of the trough that corresponds to value.
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Scrollbar < Widget
|
3
4
|
include Cget, Configure
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'scrollbar'
|
8
|
+
end
|
6
9
|
|
7
10
|
# Marks the element indicated by element as active, which causes it to be
|
8
11
|
# displayed as specified by the activeBackground and activeRelief options.
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Spinbox < Widget
|
3
4
|
include Cget, Configure
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'spinbox'
|
8
|
+
end
|
6
9
|
|
7
10
|
# Returns a list of four numbers describing the bounding box of the
|
8
11
|
# character given by index.
|
data/lib/ffi-tk/widget/text.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Tk
|
2
3
|
class Text < Widget
|
3
4
|
include Cget, Configure, Scrollable
|
4
5
|
|
5
|
-
def self.tk_command
|
6
|
+
def self.tk_command
|
7
|
+
'text'
|
8
|
+
end
|
6
9
|
|
7
10
|
autoload :Peer, 'ffi-tk/widget/text/peer'
|
8
11
|
|
@@ -111,7 +114,7 @@ module Tk
|
|
111
114
|
# :xpixels, :ypixels` is perfectly valid and will return a list of two
|
112
115
|
# elements.
|
113
116
|
def count(index1, index2, *options)
|
114
|
-
args = options.map
|
117
|
+
args = options.map(&:to_tcl_option)
|
115
118
|
execute('count', *args, index1, index2)
|
116
119
|
end
|
117
120
|
|
@@ -200,7 +203,10 @@ module Tk
|
|
200
203
|
invocation = []
|
201
204
|
indices = [given_index]
|
202
205
|
|
203
|
-
|
206
|
+
loop do
|
207
|
+
arg = arguments.shift
|
208
|
+
break unless arg
|
209
|
+
|
204
210
|
if arg.respond_to?(:to_tcl_option)
|
205
211
|
case tcl_option = arg.to_tcl_option
|
206
212
|
when '-command'
|
@@ -363,7 +369,7 @@ module Tk
|
|
363
369
|
# markName is set to the given value.
|
364
370
|
def mark_gravity(name, direction = None)
|
365
371
|
if direction == None
|
366
|
-
execute('mark', 'gravity', name)
|
372
|
+
execute('mark', 'gravity', name)&.to_sym
|
367
373
|
else
|
368
374
|
execute_only('mark', 'gravity', name, direction)
|
369
375
|
end
|
@@ -389,7 +395,7 @@ module Tk
|
|
389
395
|
# after end with respect to the pathName mark next operation.
|
390
396
|
# nil is returned if there are no marks after index.
|
391
397
|
def mark_next(index)
|
392
|
-
execute('mark', 'next', index)
|
398
|
+
execute('mark', 'next', index)&.to_sym
|
393
399
|
end
|
394
400
|
|
395
401
|
# Returns the name of the mark at or before index.
|
@@ -404,7 +410,7 @@ module Tk
|
|
404
410
|
# mark information returned by the pathName dump operation.
|
405
411
|
# nil is returned if there are no marks before index.
|
406
412
|
def mark_previous(index)
|
407
|
-
execute('mark', 'previous', index)
|
413
|
+
execute('mark', 'previous', index)&.to_sym
|
408
414
|
end
|
409
415
|
|
410
416
|
# Sets the mark named markName to a position just before the character at
|
@@ -592,7 +598,7 @@ module Tk
|
|
592
598
|
switches << :regexp if pattern.class < CoreExtensions::Regexp
|
593
599
|
to = :end if None == to
|
594
600
|
|
595
|
-
switches.map!{|switch| switch.to_s.to_tcl_option }
|
601
|
+
switches.map! { |switch| switch.to_s.to_tcl_option }
|
596
602
|
switches.uniq!
|
597
603
|
|
598
604
|
if switches.include?('-all') && switches.delete('-count')
|
@@ -607,20 +613,20 @@ module Tk
|
|
607
613
|
|
608
614
|
if count
|
609
615
|
SEARCH_MUTEX.synchronize do
|
610
|
-
list = execute(:search, *switches, sep, pattern, from, to)
|
616
|
+
list = [*execute(:search, *switches, sep, pattern, from, to)]
|
611
617
|
return list if list.empty?
|
612
618
|
count_value = Tk.execute('set', count)
|
613
619
|
[*list, count_value]
|
614
620
|
end
|
615
621
|
elsif count_all
|
616
622
|
SEARCH_MUTEX.synchronize do
|
617
|
-
list = execute(:search, *switches, sep, pattern, from, to)
|
623
|
+
list = [*execute(:search, *switches, sep, pattern, from, to)]
|
618
624
|
return list if list.empty?
|
619
625
|
count_list = Tk.execute('set', count_all)
|
620
626
|
list.zip(count_list)
|
621
627
|
end
|
622
628
|
else
|
623
|
-
execute(:search, *switches, sep, pattern, from, to)
|
629
|
+
[*execute(:search, *switches, sep, pattern, from, to)]
|
624
630
|
end
|
625
631
|
end
|
626
632
|
|
@@ -695,12 +701,10 @@ module Tk
|
|
695
701
|
# The tag bindings will be invoked first, followed by bindings for the
|
696
702
|
# window as a whole.
|
697
703
|
def tag_bind(tag_name, sequence = None, &script)
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
return Tk.execute(:tag, :bind, tag_name, sequence)
|
703
|
-
end
|
704
|
+
if !script && None == sequence
|
705
|
+
return Tk.execute(:tag, :bind, tag_name)
|
706
|
+
elsif !script
|
707
|
+
return Tk.execute(:tag, :bind, tag_name, sequence)
|
704
708
|
end
|
705
709
|
|
706
710
|
# create name for command
|