Class | Tk::Tcllib::ICO
In: | tk/lib/tkextlib/tcllib/ico.rb
Parent: | TkImage

### Methods

clear_cache copy exe_to_ico get get_data get_image list new package_name package_version show transparent_color transparent_color write write

### Constants

PACKAGE_NAME | = | 'ico'.freeze

### Public Class methods

clear_cache(file=None)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 73
      def self.clear_cache(file=None)
        tk_call_without_enc('::ico::clearCache', file)
      end

copy(from_file, from_index, to_file, to_index, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 62
      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

exe_to_ico(exe_file, ico_file, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 68
      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

get(file, index, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 41
      def self.get(file, index, keys=nil)
        tk_call_without_enc('::ico::getIcon', file, index, *hash_kv(keys, true))
      end

get_data(file, index, keys={})

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 51
      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

get_image(file, index, keys={})

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 45
      def self.get_image(file, index, keys={})
        keys = _symbolkey2str(keys)
        keys.delete('format')
        self.new(file, index, keys)
      end

list(file, keys=nil)

[Source]

    # 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

new(file, index, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 92
      def initialize(file, index, keys=nil)
        keys = _symbolkey2str(keys)
        if keys.key?('name')
          @path = keys['name'].to_s
        else
          @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

package_name()

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 20
          def self.package_name
            PACKAGE_NAME
          end

package_version()

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 24
          def self.package_version
            begin
              TkPackage.require('ico')
            rescue
              ''
            end
          end

show(file, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 86
      def self.show(file, keys=nil)
        tk_call_without_enc('::ico::Show', file, *hash_kv(keys, true))
      end

transparent_color(image, color)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 77
      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

write(file, index, depth, data, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 57
      def self.write(file, index, depth, data, keys=nil)
        tk_call_without_enc('::ico::writeIcon', file, index, depth, data,
                            *hash_kv(keys, true))
      end

### Public Instance methods

transparent_color(color)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 110
      def transparent_color(color)
        tk_call_without_enc('::ico::transparentColor', @path, color)
        self
      end

write(file, index, depth, keys=nil)

[Source]

    # File tk/lib/tkextlib/tcllib/ico.rb, line 105
      def write(file, index, depth, keys=nil)
        Tk::Tcllib::ICO.write(file, index, depth, @path, keys=nil)
        self
      end

[Validate]