Class: Gtk2CheckBoxes::YesNo

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

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ YesNo

Returns a new instance of YesNo.



3
4
5
6
7
# File 'lib/gtk2checkboxes/gtk2checkboxes.rb', line 3

def initialize(key)
  super(key)
  add_button Gtk::Stock::NO, Gtk::ResponseType::CANCEL
  add_button Gtk::Stock::YES, Gtk::ResponseType::OK
end

Instance Method Details

#label(key) ⇒ Object



9
10
11
# File 'lib/gtk2checkboxes/gtk2checkboxes.rb', line 9

def label(key)
  Such::Label.new child, key
end

#yes?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
# File 'lib/gtk2checkboxes/gtk2checkboxes.rb', line 13

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