Methods
- #
- C
-
- column_cget,
- column_cget_strict,
- column_cget_tkstring,
- column_configinfo,
- column_configure,
- columncget,
- columncget_strict,
- columncget_tkstring,
- columnconfiginfo,
- columnconfigure,
- current_column_configinfo,
- current_columnconfiginfo,
- current_heading_configinfo,
- current_headingconfiginfo,
- current_itemconfiginfo,
- current_tag_configinfo,
- current_tagconfiginfo
- H
- I
- T
Included Modules
Instance Public methods
__itemconfiginfo_core(tagOrId, slot = nil)
Link
# File ext/tk/lib/tkextlib/tile/treeview.rb, line 25 def __itemconfiginfo_core(tagOrId, slot = nil) if TkComm::GET_CONFIGINFO_AS_ARRAY if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/) fontkey = $2 return [slot.to_s, tagfontobj(tagid(tagOrId), fontkey)] else if slot slot = slot.to_s alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot} if real_name slot = real_name.to_s end case slot when /^(#{__tile_specific_item_optkeys(tagid(tagOrId)).join('|')})$/ begin # On tile-0.7.{2-8}, 'state' options has no '-' at its head. val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << slot)) rescue # Maybe, 'state' option has '-' in future. val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) end return [slot, val] when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot] optval = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) begin val = method.call(tagOrId, optval) rescue => e warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG val = optval end return [slot, val] when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/ method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot] return [slot, self.__send__(method, tagOrId)] when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/ begin val = number(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) rescue val = nil end return [slot, val] when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/ val = num_or_str(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) return [slot, val] when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/ begin val = bool(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) rescue val = nil end return [slot, val] when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/ val = simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) return [slot, val] when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) if val =~ /^[0-9]/ return [slot, list(val)] else return [slot, val] end when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) return [slot, val] when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) if val.empty? return [slot, nil] else return [slot, TkVarAccess.new(val)] end else val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) if val.index('{') return [slot, tk_split_list(val)] else return [slot, tk_tcl2ruby(val)] end end else # ! slot ret = Hash[*(tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false))].to_a.collect{|conf| conf[0] = conf[0][1..-1] if conf[0][0] == ?- case conf[0] when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[conf[0]] optval = conf[1] begin val = method.call(tagOrId, optval) rescue => e warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG val = optval end conf[1] = val when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/ # do nothing when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/ begin conf[1] = number(conf[1]) rescue conf[1] = nil end when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/ conf[1] = num_or_str(conf[1]) when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/ begin conf[1] = bool(conf[1]) rescue conf[1] = nil end when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/ conf[1] = simplelist(conf[1]) when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/ if conf[1] =~ /^[0-9]/ conf[1] = list(conf[1]) end when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/ if conf[1].empty? conf[1] = nil else conf[1] = TkVarAccess.new(conf[1]) end else if conf[1].index('{') conf[1] = tk_split_list(conf[1]) else conf[1] = tk_tcl2ruby(conf[1]) end end conf } __item_font_optkeys(tagid(tagOrId)).each{|optkey| optkey = optkey.to_s fontconf = ret.assoc(optkey) if fontconf ret.delete_if{|inf| inf[0] =~ /^(|latin|ascii|kanji)#{optkey}$/} fontconf[1] = tagfontobj(tagid(tagOrId), optkey) ret.push(fontconf) end } __item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method| ret << [optkey.to_s, self.__send__(method, tagOrId)] } ret end end else # ! TkComm::GET_CONFIGINFO_AS_ARRAY if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/) fontkey = $2 return {slot.to_s => tagfontobj(tagid(tagOrId), fontkey)} else if slot slot = slot.to_s alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot} if real_name slot = real_name.to_s end case slot when /^(#{__tile_specific_item_optkeys(tagid(tagOrId)).join('|')})$/ begin # On tile-0.7.{2-8}, 'state' option has no '-' at its head. val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << slot)) rescue # Maybe, 'state' option has '-' in future. val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) end return {slot => val} when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot] optval = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) begin val = method.call(tagOrId, optval) rescue => e warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG val = optval end return {slot => val} when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/ method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot] return {slot => self.__send__(method, tagOrId)} when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/ begin val = number(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) rescue val = nil end return {slot => val} when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/ val = num_or_str(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) return {slot => val} when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/ begin val = bool(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) rescue val = nil end return {slot => val} when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/ val = simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))) return {slot => val} when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) if val =~ /^[0-9]/ return {slot => list(val)} else return {slot => val} end when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) return {slot => val} when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) if val.empty? return {slot => nil} else return {slot => TkVarAccess.new(val)} end else val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")) if val.index('{') return {slot => tk_split_list(val)} else return {slot => tk_tcl2ruby(val)} end end else # ! slot ret = {} ret = Hash[*(tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false))].to_a.collect{|conf| conf[0] = conf[0][1..-1] if conf[0][0] == ?- optkey = conf[0] case optkey when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[optkey] optval = conf[1] begin val = method.call(tagOrId, optval) rescue => e warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG val = optval end conf[1] = val when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/ # do nothing when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/ begin conf[1] = number(conf[1]) rescue conf[1] = nil end when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/ conf[1] = num_or_str(conf[1]) when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/ begin conf[1] = bool(conf[1]) rescue conf[1] = nil end when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/ conf[1] = simplelist(conf[1]) when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/ if conf[1] =~ /^[0-9]/ conf[1] = list(conf[1]) end when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/ if conf[1].empty? conf[1] = nil else conf[1] = TkVarAccess.new(conf[1]) end else if conf[1].index('{') return [slot, tk_split_list(conf[1])] else return [slot, tk_tcl2ruby(conf[1])] end end ret[conf[0]] = conf[1] } __item_font_optkeys(tagid(tagOrId)).each{|optkey| optkey = optkey.to_s fontconf = ret[optkey] if fontconf.kind_of?(Array) ret.delete(optkey) ret.delete('latin' << optkey) ret.delete('ascii' << optkey) ret.delete('kanji' << optkey) fontconf[1] = tagfontobj(tagid(tagOrId), optkey) ret[optkey] = fontconf end } __item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method| ret[optkey.to_s] = self.__send__(method, tagOrId) } ret end end end end
__tile_specific_item_optkeys(id)
Link
current_itemconfiginfo(tagOrId, slot = nil)
Link
Also aliased as: __current_itemconfiginfo
# File ext/tk/lib/tkextlib/tile/treeview.rb, line 486 def current_itemconfiginfo(tagOrId, slot = nil) if TkComm::GET_CONFIGINFO_AS_ARRAY if slot org_slot = slot begin conf = __itemconfiginfo_core(tagOrId, slot) if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 ) return {conf[0] => conf[-1]} end slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] end while(org_slot != slot) fail RuntimeError, "there is a configure alias loop about '#{org_slot}'" else ret = {} __itemconfiginfo_core(tagOrId).each{|conf| if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 ) ret[conf[0]] = conf[-1] end } ret end else # ! TkComm::GET_CONFIGINFO_AS_ARRAY ret = {} __itemconfiginfo_core(tagOrId, slot).each{|key, conf| ret[key] = conf[-1] if conf.kind_of?(Array) } ret end end
headingcget(tagOrId, option)
Link
Also aliased as: heading_cget
# File ext/tk/lib/tkextlib/tile/treeview.rb, line 602 def headingcget(tagOrId, option) unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ headingcget_strict(tagOrId, option) else begin headingcget_strict(tagOrId, option) rescue => e begin if current_headingconfiginfo(tagOrId).has_key?(option.to_s) # not tag error & option is known -> error on known option fail e else # not tag error & option is unknown nil end rescue fail e # tag error end end end end
headingcget_strict(tagOrId, option)
Link
Also aliased as: heading_cget_strict
# File ext/tk/lib/tkextlib/tile/treeview.rb, line 589 def headingcget_strict(tagOrId, option) if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s) begin # On tile-0.7.{2-8}, 'state' options has no '-' at its head. tk_call(*(__item_cget_cmd([:heading, tagOrId]) << option.to_s)) rescue # Maybe, 'state' option has '-' in future. tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{option}")) end else __itemcget_strict([:heading, tagOrId], option) end end
headingcget_tkstring(tagOrId, option)
Link
Treeview Heading
Also aliased as: heading_cget_tkstring
# File ext/tk/lib/tkextlib/tile/treeview.rb, line 576 def headingcget_tkstring(tagOrId, option) if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s) begin # On tile-0.7.{2-8}, 'state' options has no '-' at its head. tk_call(*(__item_cget_cmd([:heading, tagOrId]) << option.to_s)) rescue # Maybe, 'state' option has '-' in future. tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{option}")) end else __itemcget_tkstring([:heading, tagOrId], option) end end
headingconfigure(tagOrId, slot, value=None)
Link
Also aliased as: heading_configure
# File ext/tk/lib/tkextlib/tile/treeview.rb, line 623 def headingconfigure(tagOrId, slot, value=None) if slot.kind_of?(Hash) slot = _symbolkey2str(slot) sp_kv = [] __tile_specific_item_optkeys([:heading, tagOrId]).each{|k| sp_kv << k << _get_eval_string(slot.delete(k)) if slot.has_key?(k) } tk_call(*(__item_config_cmd([:heading, tagOrId]).concat(sp_kv))) tk_call(*(__item_config_cmd([:heading, tagOrId]).concat(hash_kv(slot)))) elsif __tile_specific_item_optkeys([:heading, tagOrId]).index(slot.to_s) begin # On tile-0.7.{2-8}, 'state' options has no '-' at its head. tk_call(*(__item_cget_cmd([:heading, tagOrId]) << slot.to_s << value)) rescue # Maybe, 'state' option has '-' in future. tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{slot}" << value)) end else __itemconfigure([:heading, tagOrId], slot, value) end self end