Class: Gtk3App::YesNoDialog
- Inherits:
-
Such::Dialog
- Object
- Such::Dialog
- Gtk3App::YesNoDialog
- Defined in:
- lib/gtk3app/widgets.rb
Instance Method Summary collapse
- #add_label(text) ⇒ Object
-
#initialize ⇒ YesNoDialog
constructor
A new instance of YesNoDialog.
- #ok? ⇒ Boolean
Constructor Details
#initialize ⇒ YesNoDialog
Returns a new instance of YesNoDialog.
42 43 44 45 46 |
# File 'lib/gtk3app/widgets.rb', line 42 def initialize(...) super(...) '_No', Gtk::ResponseType::CANCEL '_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
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 |