Class: Gtk2CheckBoxes::EntryDialog

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

Instance Method Summary collapse

Constructor Details

#initialize(*par) ⇒ EntryDialog

Returns a new instance of EntryDialog.



22
23
24
25
26
# File 'lib/gtk2checkboxes/gtk2checkboxes.rb', line 22

def initialize(*par)
  super(*par)
  add_button Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL
  add_button Gtk::Stock::OK, Gtk::ResponseType::OK
end

Instance Method Details

#entry(*par) ⇒ Object



28
29
30
# File 'lib/gtk2checkboxes/gtk2checkboxes.rb', line 28

def entry(*par)
  @entry = Such::Entry.new child, *par
end

#textObject



32
33
34
35
36
37
# File 'lib/gtk2checkboxes/gtk2checkboxes.rb', line 32

def text
  show_all
  text = (run == Gtk::ResponseType::OK)? @entry.text : nil
  destroy
  text
end