# File tk/lib/tkextlib/tcllib/ico.rb, line 103
def self.clear_cache(file=None)
tk_call_without_enc('::ico::clearCache', file)
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 92
def self.copy(from_file, from_index, to_file, to_index, keys=nil)
tk_call_without_enc('::ico::copyIcon',
from_file, from_index, to_file, to_index,
*hash_kv(keys, true))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 98
def self.exe_to_ico(exe_file, ico_file, keys=nil)
tk_call_without_enc('::ico::copyIcon', exe_file, ico_file,
*hash_kv(keys, true))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 56
def self.get(file, index, keys=nil)
tk_call_without_enc('::ico::getIcon', file, index, *hash_kv(keys, true))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 63
def self.get_by_name(file, name, keys=nil)
tk_call_without_enc('::ico::getIconByName', file, name,
*hash_kv(keys, true))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 81
def self.get_data(file, index, keys={})
keys['format'] = 'data'
tk_split_list(tk_call_without_enc('::ico::getIcon', file, index,
*hash_kv(keys, true)))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 71
def self.get_fileicon(file, keys=nil)
tk_call_without_enc('::ico::getFileIcon', file, *hash_kv(keys, true))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 59
def self.get_icon(*args)
get(*args)
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 67
def self.get_icon_by_name(*args)
get_by_name(*args)
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 75
def self.get_image(file, index, keys={})
keys = _symbolkey2str(keys)
keys.delete('format')
self.new(file, index, keys)
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 48
def self.get_members(file, name, keys=nil)
tk_split_simplelist(tk_call_without_enc('::ico::getMembers', file, name,
*hash_kv(keys, true))).map{|elem|
name, width, height, bpp = tk_split_simplelist(elem)
[name, number(width), number(height), number(bpp)]
}
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 41
def self.icons(file, keys=nil)
tk_split_simplelist(tk_call_without_enc('::ico::icons', file,
*hash_kv(keys, true))).map{|elem|
num_or_str(elem)
}
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 36
def self.list(file, keys=nil)
tk_split_list(tk_call_without_enc('::ico::getIconList', file,
*hash_kv(keys, true)))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 122
def initialize(file, index, keys=nil)
keys = _symbolkey2str(keys)
if keys.key?('name')
@path = keys['name'].to_s
else
Tk_Image_ID.mutex.synchronize{
@path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
Tk_Image_ID[1].succ!
}
end
tk_call_without_enc('::ico::getIcon', file, index, '-name', @path,
'-format', 'image', *hash_kv(keys, true))
Tk_IMGTBL[@path] = self
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 20
def self.package_name
PACKAGE_NAME
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 24
def self.package_version
begin
TkPackage.require('ico')
rescue
''
end
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 116
def self.show(file, keys=nil)
tk_call_without_enc('::ico::Show', file, *hash_kv(keys, true))
end
# File tk/lib/tkextlib/tcllib/ico.rb, line 107
def self.transparent_color(image, color)
if image.kind_of?(Array)
tk_split_list(tk_call_without_enc('::ico::transparentColor',
image, color))
else
tk_call_without_enc('::ico::transparentColor', image, color)
end
end
Commenting is here to help enhance the documentation. For example, sample code, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.