Module: TkItemConfigOptkeys

Constant Summary

Constants included from TkUtil

TkUtil::None, TkUtil::RELEASE_DATE

Instance Method Summary collapse

Methods included from TkUtil

_conv_args, #_conv_args, #_fromUTF8, _get_eval_enc_str, #_get_eval_enc_str, #_get_eval_string, _get_eval_string, _symbolkey2str, #_symbolkey2str, #_toUTF8, bool, #bool, callback, eval_cmd, #hash_kv, hash_kv, install_cmd, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd

Instance Method Details

#__conv_item_keyonly_opts(id, keys) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'ext/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) ⇒ Object



113
114
115
# File 'ext/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