Class: Gtk2AppLib::Dialogs::ShowImage

Inherits:
Gtk::Dialog
  • Object
show all
Defined in:
lib/gtk2applib/dialogs/show_image.rb

Overview

creates a show image dialog

Instance Method Summary (collapse)

Constructor Details

- (ShowImage) initialize(uri, cache_directory, options)

Returns a new instance of ShowImage



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gtk2applib/dialogs/show_image.rb', line 9

def initialize(uri, cache_directory, options)
  @options = options
  super(@options[:TITLE],
    @options[:WINDOW], @options[:FLAGS], *@options[:DIALOG_BUTTONS])
  # Add the message in a label, and
  # show everything we've added to the dialog.
  box = self.vbox
  image = Widgets::CachedImage.new(cache_directory,
    box, *@options[:CachedImage])
  image.uri(uri)
end

Instance Method Details

- (Object) run



21
22
23
24
25
26
# File 'lib/gtk2applib/dialogs/show_image.rb', line 21

def run
  self.show_all
  # Ensure that the dialog box is destroyed when the user responds.
  self.signal_connect('response') { self.destroy }
  super()
end