Class: Gtk3App::YesNoDialog

Inherits:
Such::Dialog
  • Object
show all
Defined in:
lib/gtk3app/widgets.rb

Instance Method Summary collapse

Constructor Details

#initializeYesNoDialog

Returns a new instance of YesNoDialog.



42
43
44
45
46
# File 'lib/gtk3app/widgets.rb', line 42

def initialize(...)
  super(...)
  add_button '_No', Gtk::ResponseType::CANCEL
  add_button '_Yes', Gtk::ResponseType::OK
end

Instance Method Details

#add_label(text) ⇒ Object



48
49
50
# File 'lib/gtk3app/widgets.rb', line 48

def add_label(text)
  Such::Label.new(child).text = text
end

#ok?Boolean

Returns:

  • (Boolean)


52
53
54
55
56
57
# File 'lib/gtk3app/widgets.rb', line 52

def ok?
  show_all
  response = run
  destroy
  response == Gtk::ResponseType::OK
end