TkImage (Class)

In: tk/lib/tk/image.rb
Parent: TkObject

Methods

delete   height   inuse   itemtype   names   new   types   width  

Constants

TkCommandNames = ['image'.freeze].freeze
Tk_IMGTBL = TkCore::INTERP.create_table
Tk_Image_ID = ['i'.freeze, '00000'.taint].freeze

Included Modules

Tk

Public Class methods

[Source]

# File tk/lib/tk/image.rb, line 42
  def TkImage.names
    Tk.tk_call_without_enc('image', 'names').split.collect!{|id|
      (Tk_IMGTBL[id])? Tk_IMGTBL[id] : id
    }
  end

[Source]

# File tk/lib/tk/image.rb, line 17
  def initialize(keys=nil)
    @path = Tk_Image_ID.join('')
    Tk_Image_ID[1].succ!
    tk_call_without_enc('image', 'create', @type, @path, *hash_kv(keys, true))
    Tk_IMGTBL[@path] = self
  end

[Source]

# File tk/lib/tk/image.rb, line 48
  def TkImage.types
    Tk.tk_call_without_enc('image', 'types').split
  end

Public Instance methods

[Source]

# File tk/lib/tk/image.rb, line 24
  def delete
    Tk_IMGTBL.delete(@id) if @id
    tk_call_without_enc('image', 'delete', @path)
    self
  end

[Source]

# File tk/lib/tk/image.rb, line 29
  def height
    number(tk_call_without_enc('image', 'height', @path))
  end

[Source]

# File tk/lib/tk/image.rb, line 32
  def inuse
    bool(tk_call_without_enc('image', 'inuse', @path))
  end

[Source]

# File tk/lib/tk/image.rb, line 35
  def itemtype
    tk_call_without_enc('image', 'type', @path)
  end

[Source]

# File tk/lib/tk/image.rb, line 38
  def width
    number(tk_call_without_enc('image', 'width', @path))
  end

[Validate]