Module: IconLoader

Defined in:
lib/fugit/icon_loader.rb

Constant Summary collapse

IconBasePath =
File.expand_path(File.join(File.dirname(__FILE__), "..", "icons"))

Instance Method Summary collapse

Instance Method Details

#get_icon(name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/fugit/icon_loader.rb', line 5

def get_icon(name)
  icon = File.join(IconBasePath, name)
  case name[-3..-1].downcase
  when "png"
    bitmap_type = BITMAP_TYPE_PNG
  else
    bitmap_type = BITMAP_TYPE_GIF
  end

  Wx::Bitmap.new(icon, bitmap_type)
end