Class: Mireru::Widget::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/mireru/widget/image.rb

Class Method Summary collapse

Class Method Details

.create(file, width, height) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/mireru/widget/image.rb', line 5

def create(file, width, height)
  image = Gtk::Image.new
  pixbuf = Gdk::Pixbuf.new(file)
  if pixbuf.width > width || pixbuf.height > height
    pixbuf = Gdk::Pixbuf.new(file, width, height)
  end
  image.pixbuf = pixbuf
  widget = image
end