Class: JLDrill::Gtk::PromptWindow
- Inherits:
-
Gtk::Dialog
- Object
- Gtk::Dialog
- JLDrill::Gtk::PromptWindow
- Includes:
- Context::Gtk::Widget
- Defined in:
- lib/jldrill/views/gtk/widgets/PromptWindow.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Attributes included from Context::Gtk::Widget
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(view, title, message) ⇒ PromptWindow
constructor
A new instance of PromptWindow.
Methods included from Context::Gtk::Widget
#addToThisWidget, #afterWidgetIsAdded, #afterWidgetIsRemoved, #expandWidgetHeight, #expandWidgetHeight?, #expandWidgetWidth, #expandWidgetWidth?, #gtkAddWidget, #gtkRemoveWidget, #isAMainWindow, #isInTests?, #removeFromThisWidget, #setupWidget, #widgetWasAddedTo, #widgetWasRemovedFrom
Constructor Details
#initialize(view, title, message) ⇒ PromptWindow
Returns a new instance of PromptWindow.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jldrill/views/gtk/widgets/PromptWindow.rb', line 11 def initialize(view, title, ) @view = view @response = @view.context.cancel super(title, nil, Gtk::Dialog::DESTROY_WITH_PARENT, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::NO, Gtk::Dialog::RESPONSE_NO], [Gtk::Stock::YES, Gtk::Dialog::RESPONSE_YES]) self.vbox.add(Gtk::Label.new()) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/jldrill/views/gtk/widgets/PromptWindow.rb', line 9 def response @response end |
Instance Method Details
#execute ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jldrill/views/gtk/widgets/PromptWindow.rb', line 22 def execute self.run do |response| case response when Gtk::Dialog::RESPONSE_YES @response = @view.context.yes when Gtk::Dialog::RESPONSE_NO @response = @view.context.no else @response = @view.context.cancel end end @response end |