ffi-tk 2009.12.14 → 2010.01

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 (42) hide show
  1. data/.gitignore +1 -0
  2. data/AUTHORS +5 -0
  3. data/CHANGELOG +340 -192
  4. data/MANIFEST +5 -0
  5. data/README.md +3 -4
  6. data/Rakefile +1 -1
  7. data/example/tile/themes.rb +13 -0
  8. data/ffi-tk.gemspec +6 -6
  9. data/lib/ffi-tk/command/bind.rb +21 -4
  10. data/lib/ffi-tk/command/bindtags.rb +6 -2
  11. data/lib/ffi-tk/command/clipboard.rb +7 -2
  12. data/lib/ffi-tk/command/event.rb +2 -2
  13. data/lib/ffi-tk/command/get_open_file.rb +4 -2
  14. data/lib/ffi-tk/command/get_save_file.rb +4 -2
  15. data/lib/ffi-tk/command/grab.rb +2 -2
  16. data/lib/ffi-tk/command/grid.rb +7 -7
  17. data/lib/ffi-tk/command/place.rb +2 -6
  18. data/lib/ffi-tk/command/scrollable.rb +19 -19
  19. data/lib/ffi-tk/command/selection.rb +3 -3
  20. data/lib/ffi-tk/command/tk_cmd.rb +4 -3
  21. data/lib/ffi-tk/command/winfo.rb +2 -2
  22. data/lib/ffi-tk/core_extensions.rb +41 -14
  23. data/lib/ffi-tk/event/data.rb +40 -10
  24. data/lib/ffi-tk/event/handler.rb +11 -2
  25. data/lib/ffi-tk/ffi/tcl/interp.rb +3 -0
  26. data/lib/ffi-tk/ffi/tcl.rb +1 -0
  27. data/lib/ffi-tk/ffi/tk.rb +33 -0
  28. data/lib/ffi-tk/tk.rb +2 -2
  29. data/lib/ffi-tk/version.rb +3 -0
  30. data/lib/ffi-tk/widget/canvas.rb +11 -7
  31. data/lib/ffi-tk/widget/checkbutton.rb +3 -3
  32. data/lib/ffi-tk/widget/listbox.rb +3 -3
  33. data/lib/ffi-tk/widget/menu.rb +5 -6
  34. data/lib/ffi-tk/widget/panedwindow.rb +95 -69
  35. data/lib/ffi-tk/widget/text.rb +43 -11
  36. data/lib/ffi-tk/widget/tile/notebook.rb +17 -10
  37. data/lib/ffi-tk/widget/tile/panedwindow.rb +53 -1
  38. data/lib/ffi-tk/widget/tile/sizegrip.rb +2 -2
  39. data/lib/ffi-tk/widget/tile/style.rb +1 -1
  40. data/lib/ffi-tk/widget/tile/treeview.rb +6 -2
  41. data/spec/ffi-tk/command/bind.rb +25 -0
  42. metadata +8 -3
@@ -3,7 +3,59 @@ module Tk
3
3
  class PanedWindow < Tk::PanedWindow
4
4
  def self.tk_command; 'ttk::panedwindow'; end
5
5
  include TileWidget
6
+
7
+ # pathname add subwindow options...
8
+ # Adds a new pane to the window.
9
+ # subwindow must be a direct child of the paned window pathname.
10
+ # See PANE OPTIONS for the list of available options.
11
+ def add(subwindow, options = {})
12
+ execute_only(:add, subwindow, options.to_tcl_options)
13
+ end
14
+
15
+ # pathname forget pane
16
+ # Removes the specified subpane from the widget.
17
+ # pane is either an integer index or the name of a managed subwindow.
18
+ def forget(pane)
19
+ execute_only(:forget, pane)
20
+ end
21
+
22
+ # pathname identify x y
23
+ # Returns the index of the sash at point x,y, or the empty string if x,y
24
+ # is not over a sash.
25
+ def identify(x, y)
26
+ execute(:identify, x, y)
27
+ end
28
+
29
+ # pathname insert pos subwindow options...
30
+ # Inserts a pane at the specified position.
31
+ # pos is either the string end, an integer index, or the name of a managed
32
+ # subwindow. If subwindow is already managed by the paned window, moves it
33
+ # to the specified position.
34
+ # See PANE OPTIONS for the list of available options.
35
+ def insert(pos, subwindow, options = {})
36
+ execute_only(:insert, pos, subwindow, options.to_tcl_options)
37
+ end
38
+
39
+ # pathname pane pane -option ?value ?-option value...
40
+ # Query or modify the options of the specified pane, where pane is either
41
+ # an integer index or the name of a managed subwindow.
42
+ # If no -option is specified, returns a dictionary of the pane option
43
+ # values. If one -option is specified, returns the value of that option.
44
+ # Otherwise, sets the -options to the corresponding values.
45
+ def pane(pane, options = {})
46
+ common_configure([:pane, pane], options)
47
+ end
48
+
49
+ # pathname sashpos index ?newpos?
50
+ # If newpos is specified, sets the position of sash number index.
51
+ # May adjust the positions of adjacent sashes to ensure that positions are
52
+ # monotonically increasing.
53
+ # Sash positions are further constrained to be between 0 and the total
54
+ # size of the widget.
55
+ # Returns the new position of sash number index.
56
+ def sashpos(index, newpos = None)
57
+ execute(:sashpos, index, newpos)
58
+ end
6
59
  end
7
60
  end
8
61
  end
9
-
@@ -17,8 +17,8 @@ module Tk
17
17
  # BUG: http://tcl.activestate.com/man/tcl8.5/TkCmd/ttk_sizegrip.htm
18
18
  # If the containing toplevel's position was specified relative to the
19
19
  # right or bottom of the screen (e.g., 'wm geometry ... wxh-x-y' instead
20
- # of wm geometry ... wxh+x+y), the sizegrip widget will not resize the
21
- # window. ttk::sizegrip widgets only support southeast resizing.
20
+ # of "wm geometry ... wxh+x+y"), the sizegrip widget will not resize the
21
+ # window. ttk::sizegrip widgets only support "southeast" resizing.
22
22
  end
23
23
  end
24
24
  end
@@ -103,7 +103,7 @@ module Tk
103
103
  # Returns the value specified for -option in style style in state
104
104
  # state, using the standard lookup rules for element options.
105
105
  # state is a list of state names; if omitted, it defaults to all
106
- # bits off (the normal state). If the default argument is present,
106
+ # bits off (the "normal" state). If the default argument is present,
107
107
  # it is used as a fallback value in case no specification
108
108
  # for -option is found.
109
109
  def self.lookup(style, option, state=Tk::None, default=Tk::None)
@@ -217,6 +217,10 @@ module Tk
217
217
  tk_parent.children(id, *new_children)
218
218
  end
219
219
 
220
+ def selection_set
221
+ tk_parent.selection_set(id)
222
+ end
223
+
220
224
  def selection_add
221
225
  tk_parent.selection_add(id)
222
226
  end
@@ -322,12 +326,12 @@ module Tk
322
326
 
323
327
  # Returns the list of selected items.
324
328
  def selection
325
- execute(:selection).to_a
329
+ execute(:selection).to_a.map{|id| Item.new(self, id) }
326
330
  end
327
331
 
328
332
  # +items+ becomes the new selection.
329
333
  def selection_set(*items)
330
- execute(:selection, set, *items.flatten)
334
+ execute(:selection, :set, *items.flatten)
331
335
  end
332
336
 
333
337
  # Add +items+ to the selection
@@ -0,0 +1,25 @@
1
+ require_relative '../../helper'
2
+
3
+ describe Tk::Bind do
4
+ entry = Tk::Entry.new
5
+ entry.pack
6
+ entry.focus
7
+
8
+ it 'should bind a block' do
9
+ foo = false
10
+ entry.bind('f'){ foo = true }
11
+ Tk.interp.do_events_until{
12
+ Tk::Event.generate(entry, 'f')
13
+ foo
14
+ }
15
+ foo.should == true
16
+ end
17
+
18
+ it 'should return the bound proc' do
19
+ entry.bind('f').should == ' ::RubyFFI::event 0 f %# %b %c %d %f %h %i %k %m %o %p %s %t %w %x %y %A %B %D %E %K %N %P %R %S %T %W %X %Y '
20
+ end
21
+
22
+ it 'should list the sequences bound' do
23
+ entry.bind.should == ['f']
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-tk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2009.12.14
4
+ version: "2010.01"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael 'manveru' Fellinger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-14 00:00:00 +09:00
12
+ date: 2010-01-30 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.5.1
23
+ version: 0.5.4
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bacon
@@ -41,6 +41,8 @@ extensions: []
41
41
  extra_rdoc_files: []
42
42
 
43
43
  files:
44
+ - .gitignore
45
+ - AUTHORS
44
46
  - CHANGELOG
45
47
  - MANIFEST
46
48
  - README.md
@@ -62,6 +64,7 @@ files:
62
64
  - example/tile/kroc_rb_demo.rb
63
65
  - example/tile/notebook.rb
64
66
  - example/tile/theme_hello.rb
67
+ - example/tile/themes.rb
65
68
  - example/tile/treeview.rb
66
69
  - example/tkgo.rb
67
70
  - example/various.rb
@@ -117,6 +120,7 @@ files:
117
120
  - lib/ffi-tk/thread_sender.rb
118
121
  - lib/ffi-tk/tk.rb
119
122
  - lib/ffi-tk/variable.rb
123
+ - lib/ffi-tk/version.rb
120
124
  - lib/ffi-tk/widget.rb
121
125
  - lib/ffi-tk/widget/button.rb
122
126
  - lib/ffi-tk/widget/canvas.rb
@@ -167,6 +171,7 @@ files:
167
171
  - lib/ffi-tk/widget/tile/style.rb
168
172
  - lib/ffi-tk/widget/tile/treeview.rb
169
173
  - lib/ffi-tk/widget/toplevel.rb
174
+ - spec/ffi-tk/command/bind.rb
170
175
  - spec/ffi-tk/command/bindtags.rb
171
176
  - spec/ffi-tk/command/clipboard.rb
172
177
  - spec/ffi-tk/command/font.rb