Class: Gtk2CheckBoxes::EntryDialog

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

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ EntryDialog

Returns a new instance of EntryDialog.



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

def initialize(key)
  super(key)
  add_button Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL
  @ok = add_button Gtk::Stock::OK, Gtk::ResponseType::OK
end

Instance Method Details

#entry(key) ⇒ Object



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

def entry(key)
  @entry = Such::Entry.new(child, key){@ok.clicked}
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