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.



158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/sh_util.rb', line 158

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



173
174
175
# File 'lib/sh_util.rb', line 173

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