Method: TkItemConfigMethod#__current_itemconfiginfo

Defined in:
ext/lib/tk/itemconfig.rb

#__current_itemconfiginfo(tagOrId, slot = nil) ⇒ Object



1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
# File 'ext/lib/tk/itemconfig.rb', line 1178

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