diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/tile')
-rw-r--r-- | ext/tk/lib/tkextlib/tile/setup.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/style.rb | 26 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tcheckbutton.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tlabelframe.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tmenubutton.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tnotebook.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tpaned.rb | 22 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/tradiobutton.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tile/treeview.rb | 12 |
9 files changed, 38 insertions, 38 deletions
diff --git a/ext/tk/lib/tkextlib/tile/setup.rb b/ext/tk/lib/tkextlib/tile/setup.rb index ce0f0bd4d4..ee406c6ca0 100644 --- a/ext/tk/lib/tkextlib/tile/setup.rb +++ b/ext/tk/lib/tkextlib/tile/setup.rb @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb index ca7ee99c32..26d79d378b 100644 --- a/ext/tk/lib/tkextlib/tile/style.rb +++ b/ext/tk/lib/tkextlib/tile/style.rb @@ -21,16 +21,16 @@ class << Tk::Tile::Style TkCommandNames = ['style'.freeze].freeze # --- Tk::Tile::Style.__define_wrapper_proc_for_compatibility__! --- - # On Ttk (Tile) extension, 'style' command has imcompatible changes - # depend on the version of the extention. It requires modifying the - # Tcl/Tk scripts to define local styles. The rule for modification - # is a simple one. But, if users want to keep compatibility between - # versions of the extension, they will have to contrive to do that. + # On Ttk (Tile) extension, 'style' command has imcompatible changes + # depend on the version of the extention. It requires modifying the + # Tcl/Tk scripts to define local styles. The rule for modification + # is a simple one. But, if users want to keep compatibility between + # versions of the extension, they will have to contrive to do that. # It may be troublesome, especially for Ruby/Tk users. - # This method may help such work. This method make some definitions - # on the Tcl/Tk interpreter to work with different version of style - # command format. Please give attention to use this method. It may - # conflict with some definitions on Tcl/Tk scripts. + # This method may help such work. This method make some definitions + # on the Tcl/Tk interpreter to work with different version of style + # command format. Please give attention to use this method. It may + # conflict with some definitions on Tcl/Tk scripts. if Tk::Tile::TILE_SPEC_VERSION_ID < 7 def __define_wrapper_proc_for_compatibility__! __define_themes_and_setTheme_proc__! @@ -210,7 +210,7 @@ class << Tk::Tile::Style end def lookup(style, opt, state=None, fallback_value=None) - tk_call(TkCommandNames[0], 'lookup', style, + tk_call(TkCommandNames[0], 'lookup', style, '-' << opt.to_s, state, fallback_value) end @@ -253,7 +253,7 @@ class << Tk::Tile::Style # probably, command format is tile 0.8+ (Tcl/Tk8.5+) style if Tk::Tile::TILE_SPEC_VERSION_ID >= 8 if opts - tk_call(TkCommandNames[0], + tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec, opts) else tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec) @@ -262,7 +262,7 @@ class << Tk::Tile::Style fail ArgumentError, 'illegal arguments' if opts.key?('map') base = spec.shift opts['map'] = spec - tk_call(TkCommandNames[0], + tk_call(TkCommandNames[0], 'element', 'create', name, 'image', base, opts) end else @@ -271,7 +271,7 @@ class << Tk::Tile::Style spec = [spec, *(opts.delete('map'))] if opts.key?('map') end if opts - tk_call(TkCommandNames[0], + tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec, opts) else tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec) diff --git a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb index 172225fcec..ca79d89e58 100644 --- a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb +++ b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb @@ -15,7 +15,7 @@ module Tk end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton, +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton, :TkCheckbutton, :TkCheckButton) diff --git a/ext/tk/lib/tkextlib/tile/tlabelframe.rb b/ext/tk/lib/tkextlib/tile/tlabelframe.rb index cff66d8658..9f4a11990c 100644 --- a/ext/tk/lib/tkextlib/tile/tlabelframe.rb +++ b/ext/tk/lib/tkextlib/tile/tlabelframe.rb @@ -15,7 +15,7 @@ module Tk end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe, +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe, :TkLabelframe, :TkLabelFrame) diff --git a/ext/tk/lib/tkextlib/tile/tmenubutton.rb b/ext/tk/lib/tkextlib/tile/tmenubutton.rb index 7c6ab28e52..5612fb47eb 100644 --- a/ext/tk/lib/tkextlib/tile/tmenubutton.rb +++ b/ext/tk/lib/tkextlib/tile/tmenubutton.rb @@ -15,7 +15,7 @@ module Tk end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton, +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton, :TkMenubutton, :TkMenuButton) diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb index 4d65e363da..d02e05b211 100644 --- a/ext/tk/lib/tkextlib/tile/tnotebook.rb +++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb @@ -19,7 +19,7 @@ Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Notebook, :TkNotebook) class Tk::Tile::TNotebook < TkWindow ################################ include TkItemConfigMethod - + def __item_cget_cmd(id) [self.path, 'tab', id] end @@ -109,7 +109,7 @@ class Tk::Tile::TNotebook < TkWindow def forget(idx) tk_send('forget', idx) self - end + end def index(idx) number(tk_send('index', idx)) diff --git a/ext/tk/lib/tkextlib/tile/tpaned.rb b/ext/tk/lib/tkextlib/tile/tpaned.rb index d96ff43973..aff6cac4bb 100644 --- a/ext/tk/lib/tkextlib/tile/tpaned.rb +++ b/ext/tk/lib/tkextlib/tile/tpaned.rb @@ -13,7 +13,7 @@ module Tk end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow, +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow, :TkPanedwindow, :TkPanedWindow) @@ -127,7 +127,7 @@ class Tk::Tile::TPaned < TkWindow end conf else - tk_split_simplelist(tk_send_without_enc('pane', + tk_split_simplelist(tk_send_without_enc('pane', win)).collect{|conflist| conf = tk_split_simplelist(conflist) conf[0] = conf[0][1..-1] @@ -135,18 +135,18 @@ class Tk::Tile::TPaned < TkWindow if conf[0] == 'hide' conf[3] = bool(conf[3]) unless conf[3].empty? elsif conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[0] == 'hide' conf[4] = bool(conf[4]) unless conf[4].empty? elsif conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end conf[1] = conf[1][1..-1] if conf.size == 2 # alias info @@ -165,7 +165,7 @@ class Tk::Tile::TPaned < TkWindow { key => conf } else ret = {} - tk_split_simplelist(tk_send_without_enc('pane', + tk_split_simplelist(tk_send_without_enc('pane', win)).each{|conflist| conf = tk_split_simplelist(conflist) key = conf.shift[1..-1] @@ -173,18 +173,18 @@ class Tk::Tile::TPaned < TkWindow if key == 'hide' conf[2] = bool(conf[2]) unless conf[2].empty? elsif conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if key == 'hide' conf[3] = bool(conf[3]) unless conf[3].empty? elsif conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf.size == 1 diff --git a/ext/tk/lib/tkextlib/tile/tradiobutton.rb b/ext/tk/lib/tkextlib/tile/tradiobutton.rb index d653a6d256..72e72170cb 100644 --- a/ext/tk/lib/tkextlib/tile/tradiobutton.rb +++ b/ext/tk/lib/tkextlib/tile/tradiobutton.rb @@ -15,7 +15,7 @@ module Tk end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton, +Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton, :TkRadiobutton, :TkRadioButton) diff --git a/ext/tk/lib/tkextlib/tile/treeview.rb b/ext/tk/lib/tkextlib/tile/treeview.rb index 566e48def3..2046be8a69 100644 --- a/ext/tk/lib/tkextlib/tile/treeview.rb +++ b/ext/tk/lib/tkextlib/tile/treeview.rb @@ -20,7 +20,7 @@ module Tk::Tile::TreeviewConfig def __item_configinfo_struct(id) # maybe need to override - {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, + {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, :default_value=>nil, :current_value=>1} end private :__item_configinfo_struct @@ -451,7 +451,7 @@ module Tk::Tile::TreeviewConfig def __item_val2ruby_optkeys(id) case id[0] when :item, 'item' - { + { 'tags'=>proc{|arg_id, val| simplelist(val).collect{|tag| Tk::Tile::Treeview::Tag.id2obj(self, tag) @@ -498,7 +498,7 @@ module Tk::Tile::TreeviewConfig end slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] end while(org_slot != slot) - fail RuntimeError, + fail RuntimeError, "there is a configure alias loop about '#{org_slot}'" else ret = {} @@ -707,7 +707,7 @@ class Tk::Tile::Treeview::Item < TkObject keys = _symbolkey2str(keys) id = keys.delete('id') if id - num_or_str(tk_call(tree, 'insert', + num_or_str(tk_call(tree, 'insert', parent_item, idx, '-id', id, *hash_kv(keys))) else num_or_str(tk_call(tree, 'insert', parent_item, idx, *hash_kv(keys))) @@ -1030,7 +1030,7 @@ class Tk::Tile::Treeview < TkWindow end def tagid(id) - if id.kind_of?(Tk::Tile::Treeview::Item) || + if id.kind_of?(Tk::Tile::Treeview::Item) || id.kind_of?(Tk::Tile::Treeview::Tag) id.id elsif id.kind_of?(Array) @@ -1055,7 +1055,7 @@ class Tk::Tile::Treeview < TkWindow } end def set_children(item, *items) - tk_send_without_enc('children', item, + tk_send_without_enc('children', item, array2tk_list(items.flatten, true)) self end |