Module: GtkApp::Dialog::Support::ClassMethods

Defined in:
lib/gtk_app/dialog.rb

Instance Method Summary collapse

Instance Method Details

#show(parent, text, secondary_text = nil) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gtk_app/dialog.rb', line 16

def show(parent, text, secondary_text=nil)
  dialog = new(parent)
  dialog.text  = text
  dialog.secondary_text = secondary_text if secondary_text

  result = Gtk::Dialog::RESPONSE_NONE
  dialog.run do |response|
    result = response
  end
  dialog.destroy
  
  result
end