summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-05 07:35:41 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-05 07:35:41 +0000
commit7a7bf8b8bf13e9304fd5f87827720cad4e42f136 (patch)
treec10c475b3f637a388aa9acb2d77a9a533c389df1 /ext
parentf132f2705ded61b6b76ed829351c7f24ed0640e5 (diff)
* ext/tk/lib/multi-tk.rb: freeze callback-entry objects
* ext/tk/lib/tkextlib/tile.rb: support tile-0.6 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/ChangeLog.tkextlib36
-rw-r--r--ext/tk/lib/multi-tk.rb1
-rw-r--r--ext/tk/lib/tk.rb2
-rw-r--r--ext/tk/lib/tkextlib/tile.rb33
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb40
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb25
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb25
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb25
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb40
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb15
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb215
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb25
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb25
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb25
19 files changed, 544 insertions, 63 deletions
diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib
index d99ceece7e..75966a85b6 100644
--- a/ext/tk/ChangeLog.tkextlib
+++ b/ext/tk/ChangeLog.tkextlib
@@ -1,6 +1,40 @@
+2005-03-05 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/tile.rb: support tile-0.6
+
+ * ext/tk/lib/tkextlib/tile/tbutton.rb: ditto
+
+ * ext/tk/lib/tkextlib/tile/tcheckbutton.rb: ditto
+
+ * ext/tk/lib/tkextlib/tile/tlabel.rb: ditto
+
+ * ext/tk/lib/tkextlib/tile/tmenubutton.rb: ditto
+
+ * ext/tk/lib/tkextlib/tile/tnotebook.rb: ditto
+
+ * ext/tk/lib/tkextlib/tile/tradiobutton.rb: ditto
+
+ * ext/tk/lib/tkextlib/tile/tcombobox.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tentry.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tframe.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tlabelframe.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tprogressbar.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/treeview.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tscrollbar.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tseparator.rb: [new] ditto
+
+ * ext/tk/lib/tkextlib/tile/tsquare.rb: [new] ditto
+
2005-02-20 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib/tclx/tclx.rb: warning TclX's 'signal' command.
+ * ext/tk/lib/tkextlib/tclx/tclx.rb: warning TclX's 'signal' command.
2005-01-25 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index 268246fa73..a38f079ad2 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -71,6 +71,7 @@ class MultiTkIp
def initialize(ip, cmd)
@ip = ip
@cmd = cmd
+ freeze
end
attr_reader :ip, :cmd
def inspect
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 95e26d7264..349529f9b4 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -4002,7 +4002,7 @@ end
#Tk.freeze
module Tk
- RELEASE_DATE = '2005-03-02'.freeze
+ RELEASE_DATE = '2005-03-05'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'
diff --git a/ext/tk/lib/tkextlib/tile.rb b/ext/tk/lib/tkextlib/tile.rb
index 80a9083694..e93fcb9c19 100644
--- a/ext/tk/lib/tkextlib/tile.rb
+++ b/ext/tk/lib/tkextlib/tile.rb
@@ -13,7 +13,24 @@ require 'tkextlib/tile/setup.rb'
# load package
# TkPackage.require('tile', '0.4')
-TkPackage.require('tile')
+# TkPackage.require('tile', '0.6')
+verstr = TkPackage.require('tile')
+ver = verstr.split('.')
+if ver[0].to_i == 0 && ver[1].to_i <= 4
+ # version 0.4 or former
+ module Tk
+ module Tile
+ USE_TTK_NAMESPACE = false
+ end
+ end
+else
+ # version 0.5 or later
+ module Tk
+ module Tile
+ USE_TTK_NAMESPACE = true
+ end
+ end
+end
# autoload
module Tk
@@ -55,6 +72,12 @@ module Tk
autoload :TCheckButton, 'tkextlib/tile/tcheckbutton'
autoload :TCheckbutton, 'tkextlib/tile/tcheckbutton'
+ autoload :TEntry, 'tkextlib/tile/tentry'
+ autoload :TCombobox, 'tkextlib/tile/tcombobox'
+
+ autoload :TFrame, 'tkextlib/tile/tframe'
+ autoload :TLabelframe, 'tkextlib/tile/tlabelframe'
+
autoload :TLabel, 'tkextlib/tile/tlabel'
autoload :TMenubutton, 'tkextlib/tile/tmenubutton'
@@ -64,6 +87,14 @@ module Tk
autoload :TRadioButton, 'tkextlib/tile/tradiobutton'
autoload :TRadiobutton, 'tkextlib/tile/tradiobutton'
+ autoload :TScrollbar, 'tkextlib/tile/tsrollbar'
+
+ autoload :TSeparator, 'tkextlib/tile/tseparator'
+
+ autoload :TSquare, 'tkextlib/tile/tsquare'
+
+ autoload :TreeView, 'tkextlib/tile/treeview'
+
autoload :Style, 'tkextlib/tile/style'
end
end
diff --git a/ext/tk/lib/tkextlib/tile/tbutton.rb b/ext/tk/lib/tkextlib/tile/tbutton.rb
index b5c3475692..9a6245db82 100644
--- a/ext/tk/lib/tkextlib/tile/tbutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tbutton.rb
@@ -15,16 +15,11 @@ end
class Tk::Tile::TButton < TkButton
include Tk::Tile::TileWidget
- TkCommandNames = ['tbutton'.freeze].freeze
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::button'.freeze].freeze
+ else
+ TkCommandNames = ['::tbutton'.freeze].freeze
+ end
WidgetClassName = 'TButton'.freeze
WidgetClassNames[WidgetClassName] = self
-
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc('tbutton', @path, *hash_kv(keys, true))
- else
- tk_call_without_enc('tbutton', @path)
- end
- end
- private :create_self
end
diff --git a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
index 4ba77d95d3..aff560b699 100644
--- a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
@@ -16,16 +16,11 @@ end
class Tk::Tile::TCheckButton < TkCheckButton
include Tk::Tile::TileWidget
- TkCommandNames = ['tcheckbutton'.freeze].freeze
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::checkbutton'.freeze].freeze
+ else
+ TkCommandNames = ['::tcheckbutton'.freeze].freeze
+ end
WidgetClassName = 'TCheckbutton'.freeze
WidgetClassNames[WidgetClassName] = self
-
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc('tcheckbutton', @path, *hash_kv(keys, true))
- else
- tk_call_without_enc('tcheckbutton', @path)
- end
- end
- private :create_self
end
diff --git a/ext/tk/lib/tkextlib/tile/tcombobox.rb b/ext/tk/lib/tkextlib/tile/tcombobox.rb
new file mode 100644
index 0000000000..8c1f2e0153
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tcombobox.rb
@@ -0,0 +1,40 @@
+#
+# tcombobox widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TCombobox < Tk::Tile::TEntry
+ end
+ end
+end
+
+class Tk::Tile::TCombobox < Tk::Tile::TEntry
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::combobox'.freeze].freeze
+ else
+ TkCommandNames = ['::tcombobox'.freeze].freeze
+ end
+ WidgetClassName = 'TCombobox'.freeze
+ WidgetClassNames[WidgetClassName] = self
+
+ def current
+ number(tk_send_without_enc('current', idx))
+ 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
+end
diff --git a/ext/tk/lib/tkextlib/tile/tentry.rb b/ext/tk/lib/tkextlib/tile/tentry.rb
new file mode 100644
index 0000000000..ad47062f33
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tentry.rb
@@ -0,0 +1,25 @@
+#
+# tentry widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TEntry < TkEntry
+ end
+ end
+end
+
+class Tk::Tile::TEntry < TkEntry
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::entry'.freeze].freeze
+ else
+ TkCommandNames = ['::tentry'.freeze].freeze
+ end
+ WidgetClassName = 'TEntry'.freeze
+ WidgetClassNames[WidgetClassName] = self
+end
diff --git a/ext/tk/lib/tkextlib/tile/tframe.rb b/ext/tk/lib/tkextlib/tile/tframe.rb
new file mode 100644
index 0000000000..b77049305f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tframe.rb
@@ -0,0 +1,25 @@
+#
+# tframe widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TFrame < TkFrame
+ end
+ end
+end
+
+class Tk::Tile::TFrame < TkFrame
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::frame'.freeze].freeze
+ else
+ TkCommandNames = ['::tframe'.freeze].freeze
+ end
+ WidgetClassName = 'TFrame'.freeze
+ WidgetClassNames[WidgetClassName] = self
+end
diff --git a/ext/tk/lib/tkextlib/tile/tlabel.rb b/ext/tk/lib/tkextlib/tile/tlabel.rb
index d2eaf45273..256d37670e 100644
--- a/ext/tk/lib/tkextlib/tile/tlabel.rb
+++ b/ext/tk/lib/tkextlib/tile/tlabel.rb
@@ -15,16 +15,11 @@ end
class Tk::Tile::TLabel < TkLabel
include Tk::Tile::TileWidget
- TkCommandNames = ['tlabel'.freeze].freeze
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::label'.freeze].freeze
+ else
+ TkCommandNames = ['::tlabel'.freeze].freeze
+ end
WidgetClassName = 'TLabel'.freeze
WidgetClassNames[WidgetClassName] = self
-
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc('tlabel', @path, *hash_kv(keys, true))
- else
- tk_call_without_enc('tlabel', @path)
- end
- end
- private :create_self
end
diff --git a/ext/tk/lib/tkextlib/tile/tlabelframe.rb b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
new file mode 100644
index 0000000000..7685392934
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
@@ -0,0 +1,25 @@
+#
+# tlabelframe widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TLabelframe < Tk::Tile::TFrame
+ end
+ end
+end
+
+class Tk::Tile::TLabelframe < Tk::Tile::TFrame
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::labelframe'.freeze].freeze
+ else
+ TkCommandNames = ['::tlabelframe'.freeze].freeze
+ end
+ WidgetClassName = 'TLabelframe'.freeze
+ WidgetClassNames[WidgetClassName] = self
+end
diff --git a/ext/tk/lib/tkextlib/tile/tmenubutton.rb b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
index 332db2b74e..ba3400a51b 100644
--- a/ext/tk/lib/tkextlib/tile/tmenubutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
@@ -15,16 +15,11 @@ end
class Tk::Tile::TMenubutton < TkMenubutton
include Tk::Tile::TileWidget
- TkCommandNames = ['tmenubutton'.freeze].freeze
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::menubutton'.freeze].freeze
+ else
+ TkCommandNames = ['::tmenubutton'.freeze].freeze
+ end
WidgetClassName = 'TMenubutton'.freeze
WidgetClassNames[WidgetClassName] = self
-
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc('tmenubutton', @path, *hash_kv(keys, true))
- else
- tk_call_without_enc('tmenubutton', @path)
- end
- end
- private :create_self
end
diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb
index c693d5ce2b..47338a9f9d 100644
--- a/ext/tk/lib/tkextlib/tile/tnotebook.rb
+++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb
@@ -45,19 +45,14 @@ class Tk::Tile::TNotebook < TkWindow
include Tk::Tile::TileWidget
- TkCommandNames = ['tnotebook'.freeze].freeze
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::notebook'.freeze].freeze
+ else
+ TkCommandNames = ['::tnotebook'.freeze].freeze
+ end
WidgetClassName = 'TNotebook'.freeze
WidgetClassNames[WidgetClassName] = self
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc('tnotebook', @path, *hash_kv(keys, true))
- else
- tk_call_without_enc('tnotebook', @path)
- end
- end
- private :create_self
-
def enable_traversal()
tk_call_without_end('tile::enableNotebookTraversal', @path)
self
diff --git a/ext/tk/lib/tkextlib/tile/tprogressbar.rb b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
new file mode 100644
index 0000000000..f01aeb641b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
@@ -0,0 +1,40 @@
+#
+# tprogressbar widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TProgressbar < TkWidget
+ end
+ end
+end
+
+class Tk::Tile::TProgressbar
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::progressbar'.freeze].freeze
+ else
+ TkCommandNames = ['::tprogressbar'.freeze].freeze
+ end
+ WidgetClassName = 'TProgressbar'.freeze
+ WidgetClassNames[WidgetClassName] = self
+
+ def step
+ tk_send_without_enc('step').to_f
+ end
+ def step=(amount)
+ tk_send_without_enc('step', amount)
+ end
+
+ def start
+ tk_call_without_enc('::tile::progressbar::start', @path)
+ end
+
+ def stop
+ tk_call_without_enc('::tile::progressbar::stop', @path)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tile/tradiobutton.rb b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
index 66cba62960..5066538b87 100644
--- a/ext/tk/lib/tkextlib/tile/tradiobutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
@@ -16,16 +16,11 @@ end
class Tk::Tile::TRadioButton < TkRadioButton
include Tk::Tile::TileWidget
- TkCommandNames = ['tradiobutton'.freeze].freeze
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::radiobutton'.freeze].freeze
+ else
+ TkCommandNames = ['::tradiobutton'.freeze].freeze
+ end
WidgetClassName = 'TRadiobutton'.freeze
WidgetClassNames[WidgetClassName] = self
-
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc('tradiobutton', @path, *hash_kv(keys, true))
- else
- tk_call_without_enc('tradiobutton', @path)
- end
- end
- private :create_self
end
diff --git a/ext/tk/lib/tkextlib/tile/treeview.rb b/ext/tk/lib/tkextlib/tile/treeview.rb
new file mode 100644
index 0000000000..1a5fa97e24
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/treeview.rb
@@ -0,0 +1,215 @@
+#
+# treeview widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class Treeview < TkWindow
+ end
+
+ module TreeviewItemConfig
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'item', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'item', id]
+ end
+ private :__item_config_cmd
+
+ def __item_numstrval_optkeys(id)
+ ['width']
+ end
+ private :__item_numstrval_optkeys
+
+ def __item_strval_optkeys(id)
+ # maybe need to override
+ super(id) + ['id']
+ end
+ private :__item_strval_optkeys
+
+ def __item_boolval_optkeys(id)
+ ['open']
+ end
+ private :__item_boolval_optkeys
+
+ def __item_listval_optkeys(id)
+ ['values']
+ end
+ private :__item_listval_optkeys
+ end
+
+ module TreeviewColumnConfig
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'column', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'column', id]
+ end
+ private :__item_config_cmd
+
+ def __item_listval_optkeys(id)
+ []
+ end
+ private :__item_listval_optkeys
+
+ alias columncget itemcget
+ alias columnconfigure itemconfigure
+ alias columnconfiginfo itemconfiginfo
+ alias current_columnconfiginfo current_itemconfiginfo
+
+ private :itemcget, :itemconfigure
+ private :itemconfiginfo, :current_itemconfiginfo
+ end
+
+ module TreeviewHeadingConfig
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'heading', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'heading', id]
+ end
+ private :__item_config_cmd
+
+ def __item_listval_optkeys(id)
+ []
+ end
+ private :__item_listval_optkeys
+
+ alias headingcget itemcget
+ alias headingconfigure itemconfigure
+ alias headingconfiginfo itemconfiginfo
+ alias current_headingconfiginfo current_itemconfiginfo
+
+ private :itemcget, :itemconfigure
+ private :itemconfiginfo, :current_itemconfiginfo
+ end
+ end
+end
+
+class Tk::Tile::Treeview < TkWindow
+ include Tk::Tile::TileWidget
+ include Scrollable
+
+ include Tk::Tile::TreeviewColumnConfig
+ include Tk::Tile::TreeviewHeadingConfig
+ include Tk::Tile::TreeviewItemConfig
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::treeview'.freeze].freeze
+ else
+ TkCommandNames = ['::treeview'.freeze].freeze
+ end
+ WidgetClassName = 'Treeview'.freeze
+ WidgetClassNames[WidgetClassName] = self
+
+ def tagid(id)
+ _get_eval_string(id)
+ end
+
+ def children(item)
+ list(tk_send_without_enc('children', item))
+ end
+ def children=(item, *items)
+ tk_send_without_enc('children', item, ary2tk_list(items))
+ items
+ end
+
+ def delete(*items)
+ tk_send_without_enc('delete', ary2tk_list(items))
+ self
+ end
+
+ def detach(*items)
+ tk_send_without_enc('detach', ary2tk_list(items))
+ self
+ end
+
+ def exist?(item)
+ bool(tk_send_without_enc('exists', item))
+ end
+
+ def focus_item(item = None)
+ tk_send_without_enc('focus', item)
+ end
+
+ def identify(x, y)
+ tk_send_without_enc('identify', x, y)
+ end
+
+ def index(item)
+ number(tk_send_without_enc('index', item))
+ end
+
+ def insert(parent, idx, keys={})
+ keys = _symbolkey2str(keys)
+ id = keys.delete('id')
+ if id
+ tk_send_without_enc('insert', parent, idx, '-id', id, *hash_kv(keys))
+ else
+ tk_send_without_enc('insert', parent, idx, *hash_kv(keys))
+ end
+ self
+ end
+
+ def move(item, parent, idx)
+ tk_send_without_enc('move', item, parent, idx)
+ self
+ end
+
+ def next(item)
+ tk_send_without_enc('next', item)
+ end
+
+ def parent(item)
+ tk_send_without_enc('parent', item)
+ end
+
+ def prev(item)
+ tk_send_without_enc('prev', item)
+ end
+
+ def see(item)
+ tk_send_without_enc('see', item)
+ self
+ end
+
+ def selection_add(*items)
+ tk_send_without_enc('selection', 'add', ary2tk_list(items))
+ self
+ end
+ def selection_remove(*items)
+ tk_send_without_enc('selection', 'remove', ary2tk_list(items))
+ self
+ end
+ def selection_set(*items)
+ tk_send_without_enc('selection', 'set', ary2tk_list(items))
+ self
+ end
+ def selection_toggle(*items)
+ tk_send_without_enc('selection', 'toggle', ary2tk_list(items))
+ self
+ end
+
+ def get(item, col)
+ tk_send_without_enc('set', item, col)
+ end
+ def set(item, col, value)
+ tk_send_without_enc('set', item, col, value)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tile/tscrollbar.rb b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
new file mode 100644
index 0000000000..a0e4b10c91
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
@@ -0,0 +1,25 @@
+#
+# tscrollbar widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TScrollbar < TkScrollbar
+ end
+ end
+end
+
+class Tk::Tile::TScrollbar < TkScrollbar
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::scrollbar'.freeze].freeze
+ else
+ TkCommandNames = ['::tscrollbar'.freeze].freeze
+ end
+ WidgetClassName = 'TScrollbar'.freeze
+ WidgetClassNames[WidgetClassName] = self
+end
diff --git a/ext/tk/lib/tkextlib/tile/tseparator.rb b/ext/tk/lib/tkextlib/tile/tseparator.rb
new file mode 100644
index 0000000000..def9d12a4b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tseparator.rb
@@ -0,0 +1,25 @@
+#
+# tseparator widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TSeparator < TkWindow
+ end
+ end
+end
+
+class Tk::Tile::TSeparator < TkWindow
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::separator'.freeze].freeze
+ else
+ TkCommandNames = ['::tseparator'.freeze].freeze
+ end
+ WidgetClassName = 'TSeparator'.freeze
+ WidgetClassNames[WidgetClassName] = self
+end
diff --git a/ext/tk/lib/tkextlib/tile/tsquare.rb b/ext/tk/lib/tkextlib/tile/tsquare.rb
new file mode 100644
index 0000000000..ebcbc3c312
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tsquare.rb
@@ -0,0 +1,25 @@
+#
+# tsquare widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TSquare < TkWindow
+ end
+ end
+end
+
+class Tk::Tile::TSquare < TkWindow
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::square'.freeze].freeze
+ else
+ TkCommandNames = ['::tsquare'.freeze].freeze
+ end
+ WidgetClassName = 'TSquare'.freeze
+ WidgetClassNames[WidgetClassName] = self
+end