diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/tile')
-rw-r--r-- | ext/tk/lib/tkextlib/tile/sizegrip.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/style.rb | 28 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tbutton.rb | 7 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tcheckbutton.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tcombobox.rb | 3 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tentry.rb | 7 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tframe.rb | 7 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tlabel.rb | 7 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tlabelframe.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tmenubutton.rb | 12 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tnotebook.rb | 3 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tpaned.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tprogressbar.rb | 3 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tradiobutton.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/treeview.rb | 3 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tscale.rb | 7 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tscrollbar.rb | 9 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tseparator.rb | 3 |
18 files changed, 109 insertions, 22 deletions
diff --git a/ext/tk/lib/tkextlib/tile/sizegrip.rb b/ext/tk/lib/tkextlib/tile/sizegrip.rb index ea796583b0..c5068919a4 100644 --- a/ext/tk/lib/tkextlib/tile/sizegrip.rb +++ b/ext/tk/lib/tkextlib/tile/sizegrip.rb @@ -9,9 +9,13 @@ module Tk module Tile class SizeGrip < TkWindow end + Sizegrip = SizeGrip end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, :TkSizegrip, :TkSizeGrip) + + class Tk::Tile::SizeGrip < TkWindow include Tk::Tile::TileWidget diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb index b319d24d54..e01011cb21 100644 --- a/ext/tk/lib/tkextlib/tile/style.rb +++ b/ext/tk/lib/tkextlib/tile/style.rb @@ -52,11 +52,29 @@ class << Tk::Tile::Style style = '.' unless style if keys && keys != None - tk_call(TkCommandNames[0], 'map', style, *hash_kv(keys)) + if keys.kind_of?(Hash) + tk_call(TkCommandNames[0], 'map', style, *hash_kv(keys)) + else + simplelist(tk_call(TkCommandNames[0], 'map', style, '-' << keys.to_s)) + end else - tk_call(TkCommandNames[0], 'map', style) + ret = {} + Hash[*(simplelist(tk_call(TkCommandNames[0], 'map', style)))].each{|k, v| + ret[k[1..-1]] = list(v) + } + ret end end + alias map_configure map + + def map_configinfo(style=nil, key=None) + style = '.' unless style + map(style, key) + end + + def map_default_configinfo(key=None) + map('.', key) + end def lookup(style, opt, state=None, fallback_value=None) tk_call(TkCommandNames[0], 'lookup', style, @@ -92,16 +110,20 @@ class << Tk::Tile::Style end def theme_create(name, keys=nil) + name = name.to_s if keys && keys != None tk_call(TkCommandNames[0], 'theme', 'create', name, *hash_kv(keys)) else tk_call(TkCommandNames[0], 'theme', 'create', name) end + name end def theme_settings(name, cmd=nil, &b) + name = name.to_s cmd = Proc.new(&b) if !cmd && b tk_call(TkCommandNames[0], 'theme', 'settings', name, cmd) + name end def theme_names() @@ -109,6 +131,8 @@ class << Tk::Tile::Style end def theme_use(name) + name = name.to_s tk_call(TkCommandNames[0], 'theme', 'use', name) + name end end diff --git a/ext/tk/lib/tkextlib/tile/tbutton.rb b/ext/tk/lib/tkextlib/tile/tbutton.rb index 1142a27100..5d7db10fe9 100644 --- a/ext/tk/lib/tkextlib/tile/tbutton.rb +++ b/ext/tk/lib/tkextlib/tile/tbutton.rb @@ -7,13 +7,16 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TButton < TkButton + class TButton < Tk::Button end Button = TButton end end -class Tk::Tile::TButton < TkButton +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Button, :TkButton) + + +class Tk::Tile::TButton < Tk::Button include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb index fce799683d..172225fcec 100644 --- a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb +++ b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb @@ -7,7 +7,7 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TCheckButton < TkCheckButton + class TCheckButton < Tk::CheckButton end TCheckbutton = TCheckButton CheckButton = TCheckButton @@ -15,7 +15,11 @@ module Tk end end -class Tk::Tile::TCheckButton < TkCheckButton +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton, + :TkCheckbutton, :TkCheckButton) + + +class Tk::Tile::TCheckButton < Tk::CheckButton include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tcombobox.rb b/ext/tk/lib/tkextlib/tile/tcombobox.rb index e8e042fbd9..b64372f1c9 100644 --- a/ext/tk/lib/tkextlib/tile/tcombobox.rb +++ b/ext/tk/lib/tkextlib/tile/tcombobox.rb @@ -13,6 +13,9 @@ module Tk end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Combobox, :TkCombobox) + + class Tk::Tile::TCombobox < Tk::Tile::TEntry include Tk::Tile::TileWidget diff --git a/ext/tk/lib/tkextlib/tile/tentry.rb b/ext/tk/lib/tkextlib/tile/tentry.rb index 4d57ce7756..4b221fcb88 100644 --- a/ext/tk/lib/tkextlib/tile/tentry.rb +++ b/ext/tk/lib/tkextlib/tile/tentry.rb @@ -7,13 +7,16 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TEntry < TkEntry + class TEntry < Tk::Entry end Entry = TEntry end end -class Tk::Tile::TEntry < TkEntry +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Entry, :TkEntry) + + +class Tk::Tile::TEntry < Tk::Entry include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tframe.rb b/ext/tk/lib/tkextlib/tile/tframe.rb index 691c9c42af..3b5f98bb6e 100644 --- a/ext/tk/lib/tkextlib/tile/tframe.rb +++ b/ext/tk/lib/tkextlib/tile/tframe.rb @@ -7,13 +7,16 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TFrame < TkFrame + class TFrame < Tk::Frame end Frame = TFrame end end -class Tk::Tile::TFrame < TkFrame +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Frame, :TkFrame) + + +class Tk::Tile::TFrame < Tk::Frame include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tlabel.rb b/ext/tk/lib/tkextlib/tile/tlabel.rb index 4111d1906a..7d074d3842 100644 --- a/ext/tk/lib/tkextlib/tile/tlabel.rb +++ b/ext/tk/lib/tkextlib/tile/tlabel.rb @@ -7,13 +7,16 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TLabel < TkLabel + class TLabel < Tk::Label end Label = TLabel end end -class Tk::Tile::TLabel < TkLabel +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Label, :TkLabel) + + +class Tk::Tile::TLabel < Tk::Label include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tlabelframe.rb b/ext/tk/lib/tkextlib/tile/tlabelframe.rb index 8981232b25..cff66d8658 100644 --- a/ext/tk/lib/tkextlib/tile/tlabelframe.rb +++ b/ext/tk/lib/tkextlib/tile/tlabelframe.rb @@ -9,10 +9,16 @@ module Tk module Tile class TLabelframe < Tk::Tile::TFrame end - Labelframe = TLabelframe + TLabelFrame = TLabelframe + Labelframe = TLabelframe + LabelFrame = TLabelframe end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe, + :TkLabelframe, :TkLabelFrame) + + class Tk::Tile::TLabelframe < Tk::Tile::TFrame include Tk::Tile::TileWidget diff --git a/ext/tk/lib/tkextlib/tile/tmenubutton.rb b/ext/tk/lib/tkextlib/tile/tmenubutton.rb index 4b81fa1c81..7c6ab28e52 100644 --- a/ext/tk/lib/tkextlib/tile/tmenubutton.rb +++ b/ext/tk/lib/tkextlib/tile/tmenubutton.rb @@ -7,13 +7,19 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TMenubutton < TkMenubutton + class TMenubutton < Tk::Menubutton end - Menubutton = TMenubutton + TMenuButton = TMenubutton + Menubutton = TMenubutton + MenuButton = TMenubutton end end -class Tk::Tile::TMenubutton < TkMenubutton +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton, + :TkMenubutton, :TkMenuButton) + + +class Tk::Tile::TMenubutton < Tk::Menubutton include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb index a928e64b61..76f225c579 100644 --- a/ext/tk/lib/tkextlib/tile/tnotebook.rb +++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb @@ -13,6 +13,9 @@ module Tk end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Notebook, :TkNotebook) + + class Tk::Tile::TNotebook < TkWindow ################################ include TkItemConfigMethod diff --git a/ext/tk/lib/tkextlib/tile/tpaned.rb b/ext/tk/lib/tkextlib/tile/tpaned.rb index 2a2a25ea59..342b54d253 100644 --- a/ext/tk/lib/tkextlib/tile/tpaned.rb +++ b/ext/tk/lib/tkextlib/tile/tpaned.rb @@ -13,6 +13,10 @@ module Tk end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow, + :TkPanedwindow, :TkPanedWindow) + + class Tk::Tile::TPaned < TkWindow include Tk::Tile::TileWidget diff --git a/ext/tk/lib/tkextlib/tile/tprogressbar.rb b/ext/tk/lib/tkextlib/tile/tprogressbar.rb index 36c1c75c23..f786d370dd 100644 --- a/ext/tk/lib/tkextlib/tile/tprogressbar.rb +++ b/ext/tk/lib/tkextlib/tile/tprogressbar.rb @@ -13,6 +13,9 @@ module Tk end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Progressbar, :TkProgressbar) + + class Tk::Tile::TProgressbar include Tk::Tile::TileWidget diff --git a/ext/tk/lib/tkextlib/tile/tradiobutton.rb b/ext/tk/lib/tkextlib/tile/tradiobutton.rb index e2f614cb97..d653a6d256 100644 --- a/ext/tk/lib/tkextlib/tile/tradiobutton.rb +++ b/ext/tk/lib/tkextlib/tile/tradiobutton.rb @@ -7,7 +7,7 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TRadioButton < TkRadioButton + class TRadioButton < Tk::RadioButton end TRadiobutton = TRadioButton RadioButton = TRadioButton @@ -15,7 +15,11 @@ module Tk end end -class Tk::Tile::TRadioButton < TkRadioButton +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton, + :TkRadiobutton, :TkRadioButton) + + +class Tk::Tile::TRadioButton < Tk::RadioButton include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/treeview.rb b/ext/tk/lib/tkextlib/tile/treeview.rb index 68e478896c..36496ee0b9 100644 --- a/ext/tk/lib/tkextlib/tile/treeview.rb +++ b/ext/tk/lib/tkextlib/tile/treeview.rb @@ -12,6 +12,9 @@ module Tk end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview) + + module Tk::Tile::TreeviewConfig include TkItemConfigMethod diff --git a/ext/tk/lib/tkextlib/tile/tscale.rb b/ext/tk/lib/tkextlib/tile/tscale.rb index 7ec72e3515..2c46fd9bd4 100644 --- a/ext/tk/lib/tkextlib/tile/tscale.rb +++ b/ext/tk/lib/tkextlib/tile/tscale.rb @@ -7,7 +7,7 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TScale < TkScale + class TScale < Tk::Scale end Scale = TScale @@ -17,7 +17,10 @@ module Tk end end -class Tk::Tile::TScale < TkScale +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scale, :TkScale) + + +class Tk::Tile::TScale < Tk::Scale include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE diff --git a/ext/tk/lib/tkextlib/tile/tscrollbar.rb b/ext/tk/lib/tkextlib/tile/tscrollbar.rb index 10b84e84a0..163b8f4713 100644 --- a/ext/tk/lib/tkextlib/tile/tscrollbar.rb +++ b/ext/tk/lib/tkextlib/tile/tscrollbar.rb @@ -7,13 +7,16 @@ require 'tkextlib/tile.rb' module Tk module Tile - class TScrollbar < TkScrollbar + class TScrollbar < Tk::Scrollbar end Scrollbar = TScrollbar end end -class Tk::Tile::TScrollbar < TkScrollbar +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scrollbar, :TkScrollbar) + + +class Tk::Tile::TScrollbar < Tk::Scrollbar include Tk::Tile::TileWidget if Tk::Tile::USE_TTK_NAMESPACE @@ -47,3 +50,5 @@ class Tk::Tile::YScrollbar < Tk::Tile::TScrollbar private :create_self end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::XScrollbar, :TkXScrollbar) +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::YScrollbar, :TkYScrollbar) diff --git a/ext/tk/lib/tkextlib/tile/tseparator.rb b/ext/tk/lib/tkextlib/tile/tseparator.rb index ca731d4e5b..30fae2c525 100644 --- a/ext/tk/lib/tkextlib/tile/tseparator.rb +++ b/ext/tk/lib/tkextlib/tile/tseparator.rb @@ -13,6 +13,9 @@ module Tk end end +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Separator, :TkSeparator) + + class Tk::Tile::TSeparator < TkWindow include Tk::Tile::TileWidget |