Class: Druzy::LittleFrame::FileChooser
- Inherits:
-
MVC::Controller
- Object
- MVC::Controller
- Druzy::LittleFrame::FileChooser
- Defined in:
- lib/druzy/little_frame/file_chooser.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ FileChooser
constructor
A new instance of FileChooser.
- #notify_action(view, action, args = {}) ⇒ Object
- #result ⇒ Object
Constructor Details
#initialize(args) ⇒ FileChooser
Returns a new instance of FileChooser.
8 9 10 11 12 13 14 15 |
# File 'lib/druzy/little_frame/file_chooser.rb', line 8 def initialize(args) if (args[:model]==nil) initialize(:model => FileChooserModel.new(args)) else super(args[:model]) add_view(FileChooserView.new(self)) end end |
Instance Method Details
#notify_action(view, action, args = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/druzy/little_frame/file_chooser.rb', line 17 def notify_action(view,action,args={}) if action == :destroy @model.result = :cancel view.close elsif action == :open_clicked @model.files = args[:files] @model.result = :open view.close end end |
#result ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/druzy/little_frame/file_chooser.rb', line 28 def result if @model.result == nil @model.stopped_thread=Thread.current Thread.stop end return @model.result end |