Class: ClipboardManager::CancelOk

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

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ CancelOk

Returns a new instance of CancelOk.



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

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

Instance Method Details

#combo(key) ⇒ Object



38
39
40
# File 'lib/clipboard_manager/clipboard_manager.rb', line 38

def combo(key)
  Such::ComboBoxText.new child, key
end

#runsObject



42
43
44
45
46
47
# File 'lib/clipboard_manager/clipboard_manager.rb', line 42

def runs
  show_all
  response = run
  yield if response == Gtk::ResponseType::OK
  destroy
end