Class: KeepYourHead::DialogQuestionStart
- Inherits:
-
Object
- Object
- KeepYourHead::DialogQuestionStart
- Defined in:
- lib/Keepyourhead/gui/DialogTrainStart.rb
Constant Summary collapse
- Widgets =
["spinbutton_max_questions", "spinbutton_max_minutes"]
Instance Attribute Summary collapse
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize ⇒ DialogQuestionStart
constructor
A new instance of DialogQuestionStart.
- #max_minutes ⇒ Object
- #max_questions ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize ⇒ DialogQuestionStart
Returns a new instance of DialogQuestionStart.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/Keepyourhead/gui/DialogTrainStart.rb', line 25 def initialize( ) @glade = GladeXML.new(Resources::system("glade/DialogTrainStart.glade")) { |handler| method(handler) } Widgets.each { |name| = @glade.(name) assert eval("@#{name} = widget") } @widget = @glade.("dialog_train_start") end |
Instance Attribute Details
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
23 24 25 |
# File 'lib/Keepyourhead/gui/DialogTrainStart.rb', line 23 def @widget end |
Instance Method Details
#destroy ⇒ Object
50 51 52 |
# File 'lib/Keepyourhead/gui/DialogTrainStart.rb', line 50 def destroy @widget.destroy end |
#max_minutes ⇒ Object
57 58 59 |
# File 'lib/Keepyourhead/gui/DialogTrainStart.rb', line 57 def max_minutes @spinbutton_max_minutes.value.to_i end |
#max_questions ⇒ Object
54 55 56 |
# File 'lib/Keepyourhead/gui/DialogTrainStart.rb', line 54 def max_questions @spinbutton_max_questions.value.to_i end |
#run ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/Keepyourhead/gui/DialogTrainStart.rb', line 37 def run @widget.show response = @widget.run case response when Gtk::Dialog::RESPONSE_OK return true else end false end |