ffi-tk 2009.11.29
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.
- data/CHANGELOG +748 -0
- data/MANIFEST +188 -0
- data/README.md +85 -0
- data/Rakefile +47 -0
- data/TODO.md +62 -0
- data/bin/rwish +33 -0
- data/doc/MIT_LICENSE +18 -0
- data/doc/TCL_LICENSE +39 -0
- data/example/choose_color.rb +22 -0
- data/example/choose_directory.rb +22 -0
- data/example/dialog.rb +37 -0
- data/example/hello.rb +11 -0
- data/example/message_box.rb +26 -0
- data/example/option_menu.rb +17 -0
- data/example/popup.rb +24 -0
- data/example/set_palette.rb +32 -0
- data/example/text.rb +47 -0
- data/example/tile/kroc_demo_small.rb +123 -0
- data/example/tile/kroc_rb_demo.rb +135 -0
- data/example/tile/notebook.rb +48 -0
- data/example/tile/theme_hello.rb +38 -0
- data/example/tile/treeview.rb +71 -0
- data/example/various.rb +25 -0
- data/example/wait.rb +16 -0
- data/ffi-tk.gemspec +33 -0
- data/lib/ffi-tk.rb +76 -0
- data/lib/ffi-tk/command.rb +39 -0
- data/lib/ffi-tk/command/after.rb +36 -0
- data/lib/ffi-tk/command/bell.rb +34 -0
- data/lib/ffi-tk/command/bind.rb +11 -0
- data/lib/ffi-tk/command/bindtags.rb +69 -0
- data/lib/ffi-tk/command/cget.rb +92 -0
- data/lib/ffi-tk/command/choose_color.rb +29 -0
- data/lib/ffi-tk/command/choose_directory.rb +45 -0
- data/lib/ffi-tk/command/clipboard.rb +102 -0
- data/lib/ffi-tk/command/configure.rb +88 -0
- data/lib/ffi-tk/command/destroy.rb +12 -0
- data/lib/ffi-tk/command/dialog.rb +54 -0
- data/lib/ffi-tk/command/event.rb +79 -0
- data/lib/ffi-tk/command/focus.rb +70 -0
- data/lib/ffi-tk/command/font.rb +124 -0
- data/lib/ffi-tk/command/get_open_file.rb +85 -0
- data/lib/ffi-tk/command/get_save_file.rb +83 -0
- data/lib/ffi-tk/command/grab.rb +141 -0
- data/lib/ffi-tk/command/grid.rb +246 -0
- data/lib/ffi-tk/command/image.rb +79 -0
- data/lib/ffi-tk/command/lower.rb +23 -0
- data/lib/ffi-tk/command/message_box.rb +65 -0
- data/lib/ffi-tk/command/option_menu.rb +8 -0
- data/lib/ffi-tk/command/pack.rb +99 -0
- data/lib/ffi-tk/command/place.rb +91 -0
- data/lib/ffi-tk/command/popup.rb +14 -0
- data/lib/ffi-tk/command/raise.rb +25 -0
- data/lib/ffi-tk/command/scrollable.rb +151 -0
- data/lib/ffi-tk/command/selection.rb +132 -0
- data/lib/ffi-tk/command/set_palette.rb +9 -0
- data/lib/ffi-tk/command/tk_cmd.rb +155 -0
- data/lib/ffi-tk/command/vars.rb +82 -0
- data/lib/ffi-tk/command/wait.rb +39 -0
- data/lib/ffi-tk/command/winfo.rb +668 -0
- data/lib/ffi-tk/command/wm.rb +1025 -0
- data/lib/ffi-tk/core_extensions.rb +154 -0
- data/lib/ffi-tk/event/data.rb +60 -0
- data/lib/ffi-tk/event/handler.rb +44 -0
- data/lib/ffi-tk/ffi/tcl.rb +92 -0
- data/lib/ffi-tk/ffi/tcl/cmd_proc.rb +10 -0
- data/lib/ffi-tk/ffi/tcl/eval_result.rb +148 -0
- data/lib/ffi-tk/ffi/tcl/interp.rb +95 -0
- data/lib/ffi-tk/ffi/tcl/obj.rb +89 -0
- data/lib/ffi-tk/ffi/tcl/time.rb +36 -0
- data/lib/ffi-tk/ffi/tk.rb +35 -0
- data/lib/ffi-tk/geometry.rb +32 -0
- data/lib/ffi-tk/thread_sender.rb +26 -0
- data/lib/ffi-tk/tk.rb +222 -0
- data/lib/ffi-tk/variable.rb +46 -0
- data/lib/ffi-tk/widget.rb +68 -0
- data/lib/ffi-tk/widget/button.rb +41 -0
- data/lib/ffi-tk/widget/canvas.rb +806 -0
- data/lib/ffi-tk/widget/canvas/arc.rb +18 -0
- data/lib/ffi-tk/widget/canvas/bitmap.rb +13 -0
- data/lib/ffi-tk/widget/canvas/image.rb +10 -0
- data/lib/ffi-tk/widget/canvas/item.rb +170 -0
- data/lib/ffi-tk/widget/canvas/line.rb +16 -0
- data/lib/ffi-tk/widget/canvas/oval.rb +15 -0
- data/lib/ffi-tk/widget/canvas/polygon.rb +16 -0
- data/lib/ffi-tk/widget/canvas/rectangle.rb +15 -0
- data/lib/ffi-tk/widget/canvas/text.rb +15 -0
- data/lib/ffi-tk/widget/canvas/window.rb +11 -0
- data/lib/ffi-tk/widget/checkbutton.rb +63 -0
- data/lib/ffi-tk/widget/entry.rb +208 -0
- data/lib/ffi-tk/widget/frame.rb +12 -0
- data/lib/ffi-tk/widget/label.rb +26 -0
- data/lib/ffi-tk/widget/labelframe.rb +7 -0
- data/lib/ffi-tk/widget/listbox.rb +192 -0
- data/lib/ffi-tk/widget/menu.rb +318 -0
- data/lib/ffi-tk/widget/menubutton.rb +7 -0
- data/lib/ffi-tk/widget/message.rb +36 -0
- data/lib/ffi-tk/widget/panedwindow.rb +164 -0
- data/lib/ffi-tk/widget/radiobutton.rb +43 -0
- data/lib/ffi-tk/widget/root.rb +8 -0
- data/lib/ffi-tk/widget/scale.rb +44 -0
- data/lib/ffi-tk/widget/scrollbar.rb +114 -0
- data/lib/ffi-tk/widget/spinbox.rb +198 -0
- data/lib/ffi-tk/widget/text.rb +893 -0
- data/lib/ffi-tk/widget/text/peer.rb +10 -0
- data/lib/ffi-tk/widget/tile.rb +70 -0
- data/lib/ffi-tk/widget/tile/button.rb +8 -0
- data/lib/ffi-tk/widget/tile/checkbutton.rb +8 -0
- data/lib/ffi-tk/widget/tile/combobox.rb +43 -0
- data/lib/ffi-tk/widget/tile/entry.rb +8 -0
- data/lib/ffi-tk/widget/tile/frame.rb +13 -0
- data/lib/ffi-tk/widget/tile/label.rb +9 -0
- data/lib/ffi-tk/widget/tile/labelframe.rb +8 -0
- data/lib/ffi-tk/widget/tile/menubutton.rb +8 -0
- data/lib/ffi-tk/widget/tile/notebook.rb +93 -0
- data/lib/ffi-tk/widget/tile/panedwindow.rb +9 -0
- data/lib/ffi-tk/widget/tile/progressbar.rb +59 -0
- data/lib/ffi-tk/widget/tile/radiobutton.rb +8 -0
- data/lib/ffi-tk/widget/tile/scale.rb +8 -0
- data/lib/ffi-tk/widget/tile/scrollbar.rb +41 -0
- data/lib/ffi-tk/widget/tile/separator.rb +23 -0
- data/lib/ffi-tk/widget/tile/sizegrip.rb +24 -0
- data/lib/ffi-tk/widget/tile/style.rb +114 -0
- data/lib/ffi-tk/widget/tile/treeview.rb +414 -0
- data/lib/ffi-tk/widget/toplevel.rb +14 -0
- data/spec/ffi-tk/command/bindtags.rb +18 -0
- data/spec/ffi-tk/command/clipboard.rb +18 -0
- data/spec/ffi-tk/command/font.rb +67 -0
- data/spec/ffi-tk/command/grid.rb +6 -0
- data/spec/ffi-tk/command/image.rb +26 -0
- data/spec/ffi-tk/command/pack.rb +20 -0
- data/spec/ffi-tk/command/place.rb +20 -0
- data/spec/ffi-tk/command/selection.rb +13 -0
- data/spec/ffi-tk/command/vars.rb +32 -0
- data/spec/ffi-tk/command/winfo.rb +233 -0
- data/spec/ffi-tk/command/wm.rb +185 -0
- data/spec/ffi-tk/event.rb +95 -0
- data/spec/ffi-tk/tile/button.rb +51 -0
- data/spec/ffi-tk/tile/checkbutton.rb +13 -0
- data/spec/ffi-tk/tile/combobox.rb +65 -0
- data/spec/ffi-tk/tile/entry.rb +61 -0
- data/spec/ffi-tk/tile/frame.rb +65 -0
- data/spec/ffi-tk/tile/label.rb +17 -0
- data/spec/ffi-tk/tile/labelframe.rb +13 -0
- data/spec/ffi-tk/tile/menubutton.rb +13 -0
- data/spec/ffi-tk/tile/notebook.rb +103 -0
- data/spec/ffi-tk/tile/panedwindow.rb +13 -0
- data/spec/ffi-tk/tile/progressbar.rb +78 -0
- data/spec/ffi-tk/tile/radiobutton.rb +13 -0
- data/spec/ffi-tk/tile/scale.rb +13 -0
- data/spec/ffi-tk/tile/scrollbar.rb +43 -0
- data/spec/ffi-tk/tile/separator.rb +22 -0
- data/spec/ffi-tk/tile/sizegrip.rb +13 -0
- data/spec/ffi-tk/tile/style.rb +161 -0
- data/spec/ffi-tk/tile/treeview.rb +101 -0
- data/spec/ffi-tk/variable.rb +24 -0
- data/spec/ffi-tk/widget/button.rb +22 -0
- data/spec/ffi-tk/widget/canvas.rb +169 -0
- data/spec/ffi-tk/widget/checkbutton.rb +44 -0
- data/spec/ffi-tk/widget/entry.rb +155 -0
- data/spec/ffi-tk/widget/frame.rb +8 -0
- data/spec/ffi-tk/widget/label.rb +16 -0
- data/spec/ffi-tk/widget/labelframe.rb +12 -0
- data/spec/ffi-tk/widget/listbox.rb +19 -0
- data/spec/ffi-tk/widget/menu.rb +12 -0
- data/spec/ffi-tk/widget/menubutton.rb +12 -0
- data/spec/ffi-tk/widget/message.rb +12 -0
- data/spec/ffi-tk/widget/panedwindow.rb +12 -0
- data/spec/ffi-tk/widget/radiobutton.rb +12 -0
- data/spec/ffi-tk/widget/root.rb +9 -0
- data/spec/ffi-tk/widget/scale.rb +12 -0
- data/spec/ffi-tk/widget/scrollbar.rb +12 -0
- data/spec/ffi-tk/widget/spinbox.rb +12 -0
- data/spec/ffi-tk/widget/text.rb +246 -0
- data/spec/ffi-tk/widget/toplevel.rb +12 -0
- data/spec/helper.rb +3 -0
- data/tasks/authors.rake +21 -0
- data/tasks/bacon.rake +66 -0
- data/tasks/changelog.rake +18 -0
- data/tasks/gem.rake +22 -0
- data/tasks/gem_setup.rake +113 -0
- data/tasks/grancher.rake +12 -0
- data/tasks/manifest.rake +4 -0
- data/tasks/rcov.rake +17 -0
- data/tasks/release.rake +65 -0
- data/tasks/reversion.rake +8 -0
- data/tasks/setup.rake +12 -0
- data/tasks/ycov.rake +84 -0
- metadata +261 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Ttk package merged Tcl/Tk core (Tcl/Tk 8.5+)
|
|
2
|
+
module Tk
|
|
3
|
+
module Tile
|
|
4
|
+
autoload :Entry, 'ffi-tk/widget/tile/entry'
|
|
5
|
+
autoload :Frame, 'ffi-tk/widget/tile/frame'
|
|
6
|
+
autoload :Button, 'ffi-tk/widget/tile/button'
|
|
7
|
+
autoload :LabelFrame, 'ffi-tk/widget/tile/labelframe'
|
|
8
|
+
autoload :CheckButton, 'ffi-tk/widget/tile/checkbutton'
|
|
9
|
+
autoload :RadioButton, 'ffi-tk/widget/tile/radiobutton'
|
|
10
|
+
autoload :MenuButton, 'ffi-tk/widget/tile/menubutton'
|
|
11
|
+
autoload :PanedWindow, 'ffi-tk/widget/tile/panedwindow'
|
|
12
|
+
autoload :Label, 'ffi-tk/widget/tile/label'
|
|
13
|
+
autoload :Scale, 'ffi-tk/widget/tile/scale'
|
|
14
|
+
autoload :Scrollbar, 'ffi-tk/widget/tile/scrollbar'
|
|
15
|
+
autoload :YScrollbar, 'ffi-tk/widget/tile/scrollbar'
|
|
16
|
+
autoload :XScrollbar, 'ffi-tk/widget/tile/scrollbar'
|
|
17
|
+
autoload :Notebook, 'ffi-tk/widget/tile/notebook'
|
|
18
|
+
autoload :Separator, 'ffi-tk/widget/tile/separator'
|
|
19
|
+
autoload :Sizegrip, 'ffi-tk/widget/tile/sizegrip'
|
|
20
|
+
autoload :ComboBox, 'ffi-tk/widget/tile/combobox'
|
|
21
|
+
autoload :Progressbar, 'ffi-tk/widget/tile/progressbar'
|
|
22
|
+
autoload :Treeview, 'ffi-tk/widget/tile/treeview'
|
|
23
|
+
|
|
24
|
+
autoload :Style, 'ffi-tk/widget/tile/style'
|
|
25
|
+
|
|
26
|
+
def self.style(style, parent_name)
|
|
27
|
+
Style.style(style, parent_name)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def self.set_theme(theme)
|
|
31
|
+
Style.theme_use(theme)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
module TileWidget
|
|
35
|
+
def ttk_state(new_state = None)
|
|
36
|
+
if new_state == None
|
|
37
|
+
execute(:state).to_a
|
|
38
|
+
else
|
|
39
|
+
execute_only(:state, new_state)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def state(new_state = None)
|
|
44
|
+
ttk_state(new_state)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def style(layout_spec, name = tk_pathname)
|
|
48
|
+
Tk::Tile::Style.layout(name, layout_spec)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
include Tk::Grid
|
|
52
|
+
|
|
53
|
+
def grid(options)
|
|
54
|
+
grid_configure options
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
module Font
|
|
59
|
+
Default = 'TkDefaultFont'
|
|
60
|
+
Text = 'TkTextFont'
|
|
61
|
+
Heading = 'TkHeadingFont'
|
|
62
|
+
Caption = 'TkCaptionFont'
|
|
63
|
+
Tooltip = 'TkTooltipFont'
|
|
64
|
+
Fixed = 'TkFixedFont'
|
|
65
|
+
Menu = 'TkMenuFont'
|
|
66
|
+
SmallCaption = 'TkSmallCaptionFont'
|
|
67
|
+
Icon = 'TkIconFont'
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Tk
|
|
2
|
+
module Tile
|
|
3
|
+
# combobox combines a text field with a pop-down list of values.
|
|
4
|
+
# the user may select the value of the text field from among the values in the list.
|
|
5
|
+
class ComboBox < Tile::Entry
|
|
6
|
+
def self.tk_command; 'ttk::combobox'; end
|
|
7
|
+
include TileWidget
|
|
8
|
+
# include Cget, Configure
|
|
9
|
+
|
|
10
|
+
def postcommand(&block)
|
|
11
|
+
configure(:postcommand => block) if block
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Sets the value of the combobox to value.
|
|
15
|
+
def set(value)
|
|
16
|
+
execute_only(:set, value)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Returns the current value of the combobox.
|
|
20
|
+
def get
|
|
21
|
+
execute(:get).to_s
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# If newIndex is supplied, sets the combobox value to the element
|
|
25
|
+
# at position newIndex in the list of -values. Otherwise, returns
|
|
26
|
+
# the index of the current value in the list of -values or -1 if
|
|
27
|
+
# the current value does not appear in the list.
|
|
28
|
+
def current(newindex = None)
|
|
29
|
+
if None == newindex
|
|
30
|
+
execute(:current)
|
|
31
|
+
else
|
|
32
|
+
execute_only(:current, newindex)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# VIRTUAL EVENTS
|
|
37
|
+
# The combobox widget generates a <<ComboboxSelected>> virtual event
|
|
38
|
+
# when the user selects an element from the list of values. If the
|
|
39
|
+
# selection action unposts the listbox, this event is delivered after
|
|
40
|
+
# the listbox is unposted.
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
module Tk
|
|
2
|
+
module Tile
|
|
3
|
+
# Tk::Tile::Notebook widget manages a collection of windows
|
|
4
|
+
# and displays a single one at a time. Each slave window
|
|
5
|
+
# is associated with a tab, which the user may select to
|
|
6
|
+
# change the currently-displayed window.
|
|
7
|
+
class Notebook < Widget
|
|
8
|
+
def self.tk_command; 'ttk::notebook'; end
|
|
9
|
+
include TileWidget
|
|
10
|
+
|
|
11
|
+
def initialize(parent = Tk.root, options = {})
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def add(window, options)
|
|
16
|
+
execute_only(:add, window, options.to_tcl_options)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Returns the list of windows managed by the notebook.
|
|
20
|
+
def tabs
|
|
21
|
+
execute(:tabs).to_a
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Query or modify the options of the specific tab.
|
|
25
|
+
# If no -option is specified, returns a dictionary of the
|
|
26
|
+
# tab option values. If one -option is specified, returns
|
|
27
|
+
# the value of that option. Otherwise, sets the -options
|
|
28
|
+
# to the corresponding values.
|
|
29
|
+
def tab(window, options = None)
|
|
30
|
+
if None == options
|
|
31
|
+
execute(:tab, window)
|
|
32
|
+
else
|
|
33
|
+
execute_only(:tab, window, options.to_tcl_options)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Inserts a pane at the specified position. pos is either
|
|
38
|
+
# the string end, an integer index, or the name of a managed subwindow.
|
|
39
|
+
# If subwindow is already managed by the notebook, moves it to
|
|
40
|
+
# the specified position.
|
|
41
|
+
def insert(pos, window, options)
|
|
42
|
+
execute_only(:insert, pos, window, options.to_tcl_options)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Selects the specified tab. The associated slave window
|
|
46
|
+
# will be displayed, and the previously-selected window
|
|
47
|
+
# (if different) is unmapped. If tabid is omitted, returns
|
|
48
|
+
# the widget name of the currently selected pane.
|
|
49
|
+
def select(window)
|
|
50
|
+
execute_only(:select, window)
|
|
51
|
+
window.tk_pathname
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Remove the pane containing window from the panedwindow.
|
|
55
|
+
# All geometry management options for window will be forgotten.
|
|
56
|
+
def forget(window, *windows)
|
|
57
|
+
execute_only(:forget, window, *windows)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def hide(window)
|
|
61
|
+
execute_only(:hide, window)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns the numeric index of the tab specified by tabid,
|
|
65
|
+
# or the total number of tabs if tabid is the string 'end'.
|
|
66
|
+
def index(window)
|
|
67
|
+
execute(:index, window).to_i
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def identify(x, y)
|
|
71
|
+
execute(:identify, x, y)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def enable_traversal
|
|
75
|
+
self.class.enable_traversal self
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.enable_traversal(nb)
|
|
79
|
+
Tk.execute_only('ttk::notebook::enableTraversal', nb)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# TAB IDENTIFIERS, the tabid argument may take any of the following forms:
|
|
83
|
+
# * An integer between zero and the number of tabs;
|
|
84
|
+
# * The name of a slave window;
|
|
85
|
+
# * A positional specification of the form '@x,y', which identifies the tab
|
|
86
|
+
# * string 'current', which identifies the currently-selected tab; or:
|
|
87
|
+
# * string 'end', which returns the number of tabs (only valid for 'pathname index').
|
|
88
|
+
|
|
89
|
+
# VIRTUAL EVENTS
|
|
90
|
+
# The notebook widget generates a <<NotebookTabChanged>> virtual event after a new tab is selected.
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
module Tk
|
|
2
|
+
module Tile
|
|
3
|
+
# progressbar widget shows the status of a long-running operation.
|
|
4
|
+
# They can operate in two modes: determinate mode shows the amount
|
|
5
|
+
# completed relative to the total amount of work to be done, and
|
|
6
|
+
# indeterminate mode provides an animated display to let the user
|
|
7
|
+
# know that something is happening.
|
|
8
|
+
class Progressbar < Widget
|
|
9
|
+
def self.tk_command; 'ttk::progressbar'; end
|
|
10
|
+
include TileWidget, Cget, Configure
|
|
11
|
+
|
|
12
|
+
# Begin autoincrement mode
|
|
13
|
+
# schedules a recurring timer event that calls step every
|
|
14
|
+
# interval milliseconds. If omitted, interval defaults to
|
|
15
|
+
# 50 milliseconds (20 steps/second).
|
|
16
|
+
def start(interval = None)
|
|
17
|
+
execute_only(:start, interval)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Stop autoincrement mode
|
|
21
|
+
# cancels any recurring timer event initiated by #start
|
|
22
|
+
def stop
|
|
23
|
+
execute_only(:stop)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Increments the -value by amount. amount defaults to 1.0 if omitted.
|
|
27
|
+
def step(amount = 1.0)
|
|
28
|
+
execute_only(:step, amount)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# the current value of the progress bar. In determinate mode,
|
|
32
|
+
# this represents the amount of work completed. In indeterminate mode,
|
|
33
|
+
# it is interpreted modulo -maximum; that is, the progress bar
|
|
34
|
+
# completes one 'cycle' when the -value increases by -maximum.
|
|
35
|
+
def value
|
|
36
|
+
execute(:cget, '-value').to_f
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def phase
|
|
40
|
+
execute(:cget, '-phase').to_i
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def identify(x, y)
|
|
45
|
+
execute(:identify, x, y)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Specifies the orientation of the scrollbar.
|
|
49
|
+
# horizontal or vertical
|
|
50
|
+
def orient(orientation = None)
|
|
51
|
+
if None == orientation
|
|
52
|
+
cget(:orient)
|
|
53
|
+
else
|
|
54
|
+
configure orient: orientation
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Tk
|
|
2
|
+
module Tile
|
|
3
|
+
class Scrollbar < Tk::Scrollbar
|
|
4
|
+
def self.tk_command; 'ttk::scrollbar'; end
|
|
5
|
+
include TileWidget
|
|
6
|
+
|
|
7
|
+
def initialize(parent = Tk.root, options = {})
|
|
8
|
+
super
|
|
9
|
+
scrollbar_default
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Specifies the orientation of the scrollbar.
|
|
13
|
+
# horizontal or vertical
|
|
14
|
+
def orient(orientation = None)
|
|
15
|
+
if None == orientation
|
|
16
|
+
cget(:orient)
|
|
17
|
+
else
|
|
18
|
+
configure orient: orientation
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def command(&block)
|
|
23
|
+
configure(:command => block) if block
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def scrollbar_default; end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class YScrollbar < Tk::Tile::Scrollbar
|
|
30
|
+
def scrollbar_default
|
|
31
|
+
#configure :orient => :vertical
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class XScrollbar < Tk::Tile::Scrollbar
|
|
36
|
+
def scrollbar_default
|
|
37
|
+
configure :orient => :horizontal
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Tk
|
|
2
|
+
module Tile
|
|
3
|
+
# Separator widget displays a horizontal or vertical separator bar.
|
|
4
|
+
class Separator < Widget
|
|
5
|
+
def self.tk_command; 'ttk::separator'; end
|
|
6
|
+
include TileWidget, Cget, Configure
|
|
7
|
+
|
|
8
|
+
# Specifies the orientation of the separator.
|
|
9
|
+
# horizontal or vertical
|
|
10
|
+
def orient(orientation = None)
|
|
11
|
+
if None == orientation
|
|
12
|
+
cget(:orient)
|
|
13
|
+
else
|
|
14
|
+
configure orient: orientation
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def identify(x, y)
|
|
19
|
+
execute_only(:identify, x, y)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|