Method: JSON::Editor.fetch_icon

Defined in:
lib/json/editor.rb

.fetch_icon(name) ⇒ Object

Returns the Gdk::Pixbuf of the icon named name from the icon cache.



26
27
28
29
30
31
32
33
# File 'lib/json/editor.rb', line 26

def Editor.fetch_icon(name)
  @icon_cache ||= {}
  unless @icon_cache.key?(name)
    path = File.dirname(__FILE__)
    @icon_cache[name] = Gdk::Pixbuf.new(File.join(path, name + '.xpm'))
  end
 @icon_cache[name]
end