Method: Tk::ICONS.delete

Defined in:
lib/tkextlib/ICONS/icons.rb

.delete(*icons) ⇒ Object

icon, icon, …



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/tkextlib/ICONS/icons.rb', line 47

def self.delete(*icons)  # icon, icon, ...
  icons = icons.flatten
  return if icons.empty?
  icons.map!{|icon|
    if icon.kind_of?(Tk::ICONS)
      Tk_IMGTBL.delete(icon.path)
      icon.name
    elsif icon.to_s =~ /^::icon::(.*)/
      name = $1
      Tk_IMGTBL.delete(icon)
      name
    else
      Tk_IMGTBL.delete("::icon::#{icon}")
      icon
    end
  }
  tk_call('::icons::icons', 'delete', icons)
end