module TkItemConfigOptkeys
Public Instance Methods
__conv_item_keyonly_opts(id, keys)
click to toggle source
# File lib/tk/itemconfig.rb, line 93 def __conv_item_keyonly_opts(id, keys) return keys unless keys.kind_of?(Hash) keyonly = __item_keyonly_optkeys(id) keys2 = {} keys.each{|k, v| optkey = keyonly.find{|kk,vv| kk.to_s == k.to_s} if optkey defkey, undefkey = optkey if v keys2[defkey.to_s] = None else keys2[undefkey.to_s] = None end else keys2[k.to_s] = v end } keys2 end
itemconfig_hash_kv(id, keys, enc_mode = nil, conf = nil)
click to toggle source
# File lib/tk/itemconfig.rb, line 113 def itemconfig_hash_kv(id, keys, enc_mode = nil, conf = nil) hash_kv(__conv_item_keyonly_opts(id, keys), enc_mode, conf) end
Private Instance Methods
__item_boolval_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 26 def __item_boolval_optkeys(id) ['exportselection', 'jump', 'setgrid', 'takefocus'] end
__item_keyonly_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 86 def __item_keyonly_optkeys(id) # { def_key=>(undef_key|nil), ... } # maybe need to override {} end
__item_listval_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 43 def __item_listval_optkeys(id) [] end
__item_methodcall_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 74 def __item_methodcall_optkeys(id) # { key=>method, ... } # Use the method for both of get and set. # Usually, the 'key' will not be a widget option. # # maybe need to override # {'coords'=>'coords'} {} end
__item_numlistval_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 48 def __item_numlistval_optkeys(id) # maybe need to override ['dash', 'activedash', 'disableddash'] end
__item_numstrval_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 21 def __item_numstrval_optkeys(id) [] end
__item_numval_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 16 def __item_numval_optkeys(id) [] end
__item_optkey_aliases(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 11 def __item_optkey_aliases(id) {} end
__item_ruby2val_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 66 def __item_ruby2val_optkeys(id) # { key=>method, ... } # The method is used to convert a ruby's object to a opt-value. # When set the value of the option "key", "method.call(id, val)" is called. # That is, "-#{key} #{method.call(id, value)}". {} end
__item_strval_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 31 def __item_strval_optkeys(id) # maybe need to override [ 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile', 'activebackground', 'activeforeground', 'background', 'disabledforeground', 'disabledbackground', 'foreground', 'highlightbackground', 'highlightcolor', 'insertbackground', 'selectbackground', 'selectforeground', 'troughcolor' ] end
__item_tkvariable_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 54 def __item_tkvariable_optkeys(id) ['variable', 'textvariable'] end
__item_val2ruby_optkeys(id)
click to toggle source
# File lib/tk/itemconfig.rb, line 59 def __item_val2ruby_optkeys(id) # { key=>method, ... } # The method is used to convert a opt-value to a ruby's object. # When get the value of the option "key", "method.call(id, val)" is called. {} end