diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-04 09:52:54 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-04 09:52:54 +0000 |
commit | 088f21e2595d9f172cc676adef2ce045c18d018f (patch) | |
tree | a84cbd30f9a710d7bd3c32827beab033f2647a4f /ext/tk/lib/tkextlib/tile | |
parent | 0d4f83264fa101f4e19a7162d7a26d584be26825 (diff) |
* ext/tk/lib/tkextlib/tile.rb, lib/tkextlib/tile/* : support Tile 0.7.6.
* ext/tk/lib/tkextlib/SUPPORT_STATUS: [ruby-talk:211939] check links
of extensions.
* ext/tk/lib/tkextlib/blt/container.rb: define instance methods properly.
* ext/tk/lib/tkextlib/tile/tcombobox.rb: bug fix [ruby-talk:213003].
* ext/tk/lib/tkextlib/tile/tnotebook.rb: ditto.
* ext/tk/lib/tkextlib/tile/treeview.rb: ditto.
* ext/tk/lib/tkextlib/tile/sizegrip.rb: [new] add 'ttk::sizegrip' widget.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkextlib/tile')
-rw-r--r-- | ext/tk/lib/tkextlib/tile/style.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tcombobox.rb | 6 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tnotebook.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/treeview.rb | 53 |
4 files changed, 62 insertions, 11 deletions
diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb index 485a36d7d6..59bc4b0d78 100644 --- a/ext/tk/lib/tkextlib/tile/style.rb +++ b/ext/tk/lib/tkextlib/tile/style.rb @@ -52,6 +52,10 @@ class << Tk::Tile::Style end end + def lookup(style, opt, state=None, fallback_value=None) + tk_call('style', 'lookup', style, '-' << opt.to_s, state, fallback_value) + end + include Tk::Tile::ParseStyleLayout def layout(style=nil, spec=nil) diff --git a/ext/tk/lib/tkextlib/tile/tcombobox.rb b/ext/tk/lib/tkextlib/tile/tcombobox.rb index c63ab94dbe..e8e042fbd9 100644 --- a/ext/tk/lib/tkextlib/tile/tcombobox.rb +++ b/ext/tk/lib/tkextlib/tile/tcombobox.rb @@ -39,16 +39,12 @@ class Tk::Tile::TCombobox < Tk::Tile::TEntry end def current - number(tk_send_without_enc('current', idx)) + number(tk_send_without_enc('current')) end def current=(idx) tk_send_without_enc('current', idx) end - def identify(x, y) - tk_send_without_enc('identify', x, y) - end - def set(val) tk_send('set', val) end diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb index abaed8ee9c..a928e64b61 100644 --- a/ext/tk/lib/tkextlib/tile/tnotebook.rb +++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb @@ -27,15 +27,15 @@ class Tk::Tile::TNotebook < TkWindow end private :__item_config_cmd - def __item_listval_optkeys + def __item_listval_optkeys(id) [] end private :__item_listval_optkeys - def __item_methodcall_optkeys # { key=>method, ... } + def __item_methodcall_optkeys(id) # { key=>method, ... } {} end - private :__item_listval_optkeys + private :__item_methodcall_optkeys #alias tabcget itemcget alias tabconfigure itemconfigure @@ -104,6 +104,10 @@ class Tk::Tile::TNotebook < TkWindow self end + def selected + window(tk_send_without_enc('select')) + end + def tabs list(tk_send('tabs')) end diff --git a/ext/tk/lib/tkextlib/tile/treeview.rb b/ext/tk/lib/tkextlib/tile/treeview.rb index d3ffbbfa6b..6d6074b800 100644 --- a/ext/tk/lib/tkextlib/tile/treeview.rb +++ b/ext/tk/lib/tkextlib/tile/treeview.rb @@ -158,6 +158,10 @@ class Tk::Tile::Treeview < TkWindow end end + def bbox(item, column=None) + list(tk_send('item', 'bbox', item, column)) + end + def children(item) simplelist(tk_send_without_enc('children', item)) end @@ -186,6 +190,7 @@ class Tk::Tile::Treeview < TkWindow end def identify(x, y) + # tile-0.7.2 or previous ret = simplelist(tk_send('identify', x, y)) case ret[0] when 'heading', 'separator', 'cell' @@ -193,6 +198,14 @@ class Tk::Tile::Treeview < TkWindow end end + def row_identify(x, y) + tk_send('identify', 'row', x, y) + end + + def column_identify(x, y) + tk_send('identify', 'column', x, y) + end + def index(item) number(tk_send('index', item)) end @@ -201,11 +214,10 @@ class Tk::Tile::Treeview < TkWindow keys = _symbolkey2str(keys) id = keys.delete('id') if id - tk_send('insert', parent, idx, '-id', id, *hash_kv(keys)) + num_or_str(tk_send('insert', parent, idx, '-id', id, *hash_kv(keys))) else - tk_send('insert', parent, idx, *hash_kv(keys)) + num_or_str(tk_send('insert', parent, idx, *hash_kv(keys))) end - self end def instate(spec, cmd=Proc.new) @@ -270,6 +282,8 @@ class Tk::Tile::Treeview < TkWindow end ret end + alias get_dictionary get_directory + def get(item, col) tk_send('set', item, col) end @@ -277,4 +291,37 @@ class Tk::Tile::Treeview < TkWindow tk_send('set', item, col, value) self end + + def tag_bind(tag, seq, *args) + if TkComm._callback_entry?(args[0]) || !block_given? + cmd = args.shift + else + cmd = Proc.new + end + _bind([@path, 'tag', 'bind', tag], seq, cmd, *args) + self + end + alias tagbind tag_bind + + def tag_bind_append(tag, seq, *args) + if TkComm._callback_entry?(args[0]) || !block_given? + cmd = args.shift + else + cmd = Proc.new + end + _bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args) + self + end + alias tagbind_append tag_bind_append + + def tag_bind_remove(tag, seq) + _bind_remove([@path, 'tag', 'bind', tag], seq) + self + end + alias tagbind_remove tag_bind_remove + + def tag_bindinfo(tag, context=nil) + _bindinfo([@path, 'tag', 'bind', tag], context) + end + alias tagbindinfo tag_bindinfo end |