Class: Kelp::ImageDialog

Inherits:
Gtk::Dialog
  • Object
show all
Defined in:
lib/sh_util.rb

Instance Method Summary collapse

Constructor Details

#initialize(pixbuf, title = "") ⇒ ImageDialog

Returns a new instance of ImageDialog.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/sh_util.rb', line 123

def initialize(pixbuf, title="")
  super(title,
    nil,
    nil,
    [Stock::CANCEL, Dialog::RESPONSE_NONE])
  @image = Image.new(pixbuf)
  vbox.pack_start @image, true, true, 8
  if pixbuf
    self.width_request = pixbuf.width + 16
    self.height_request = size[1] + pixbuf.height + 16
  end
  vbox.show_all
  signal_connect('response') { destroy }
end

Instance Method Details

#pixbuf=(pixbuf) ⇒ Object



138
139
140
# File 'lib/sh_util.rb', line 138

def pixbuf=(pixbuf)
  @image.pixbuf = pixbuf
end