Class: Gtk2AppLib::Dialogs::Entry
- Inherits:
-
Gtk::Dialog
- Object
- Gtk::Dialog
- Gtk2AppLib::Dialogs::Entry
- Defined in:
- lib/gtk2applib/dialogs/entry.rb
Overview
Creates an entry dialog
Instance Method Summary (collapse)
-
- (Entry) initialize(prompt, options)
constructor
A new instance of Entry.
- - (Object) run
Constructor Details
- (Entry) initialize(prompt, options)
A new instance of Entry
8 9 10 11 12 13 14 15 |
# File 'lib/gtk2applib/dialogs/entry.rb', line 8 def initialize(prompt, ) @options = super(@options[:TITLE], @options[:WINDOW], @options[:FLAGS], *@options[:DIALOG_BUTTONS]) box = self.vbox Widgets::Label.new(prompt, box, *@options[:Label]) @entry = Widgets::Entry.new(box, *@options[:Entry]) { self.response(1) } end |
Instance Method Details
- (Object) run
17 18 19 20 21 22 23 |
# File 'lib/gtk2applib/dialogs/entry.rb', line 17 def run self.show_all = nil super { |response| = @entry.text if response == 1 } self.destroy end |