Maintenance of Ruby 2.0.0 ended on February 24, 2016. Read more
# File tk/lib/tk.rb, line 3868 def []=(id, val) configure(id, val) val end
# File tk/lib/tk.rb, line 4061 def __check_available_configure_options(keys) availables = self.current_configinfo.keys # add non-standard keys availables |= __font_optkeys.map{|k| [k.to_s, "latin#{k}", "ascii#{k}", "kanji#{k}"] }.flatten availables |= __methodcall_optkeys.keys.map{|k| k.to_s} availables |= __keyonly_optkeys.keys.map{|k| k.to_s} keys = _symbolkey2str(keys) keys.delete_if{|k, v| !(availables.include?(k))} end
# File tk/lib/tk.rb, line 3962 def cget(slot) unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ __cget_core(slot) else begin __cget_core(slot) rescue => e if current_configinfo.has_key?(slot.to_s) # error on known option fail e else # unknown option nil end end end end
# File tk/lib/tk.rb, line 3979 def cget_strict(slot) # never use TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ __cget_core(slot) end
# File tk/lib/tk.rb, line 3873 def cget_tkstring(option) opt = option.to_s fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.length == 0 tk_call_without_enc(*(__cget_cmd << "-#{opt}")) end
# File tk/lib/tk.rb, line 3858 def config_hash_kv(keys, enc_mode = nil, conf = nil) hash_kv(__conv_keyonly_opts(keys), enc_mode, conf) end
# File tk/lib/tk.rb, line 4872 def configinfo(slot = nil) if slot && TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ begin __configinfo_core(slot) rescue Array.new(__configinfo_struct.values.max).unshift(slot.to_s) end else __configinfo_core(slot) end end
# File tk/lib/tk.rb, line 4075 def configure(slot, value=None) unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ __configure_core(slot, value) else if slot.kind_of?(Hash) begin __configure_core(slot) rescue slot = __check_available_configure_options(slot) __configure_core(slot) unless slot.empty? end else begin __configure_core(slot, value) rescue => e if current_configinfo.has_key?(slot.to_s) # error on known option fail e else # unknown option nil end end end end self end
# File tk/lib/tk.rb, line 4103 def configure_cmd(slot, value) configure(slot, install_cmd(value)) end
# File tk/lib/tk.rb, line 4884 def current_configinfo(slot = nil) if TkComm::GET_CONFIGINFO_AS_ARRAY if slot org_slot = slot begin conf = configinfo(slot) if ( ! __configinfo_struct[:alias] \ || conf.size > __configinfo_struct[:alias] + 1 ) return {conf[0] => conf[-1]} end slot = conf[__configinfo_struct[:alias]] end while(org_slot != slot) fail RuntimeError, "there is a configure alias loop about '#{org_slot}'" else ret = {} configinfo().each{|cnf| if ( ! __configinfo_struct[:alias] \ || cnf.size > __configinfo_struct[:alias] + 1 ) ret[cnf[0]] = cnf[-1] end } ret end else # ! TkComm::GET_CONFIGINFO_AS_ARRAY ret = {} configinfo(slot).each{|key, cnf| ret[key] = cnf[-1] if cnf.kind_of?(Array) } ret end end