Class: Druzy::LittleFrame::FileChooser
- Inherits:
-
MVC::ControllerWithResult
- Object
- MVC::ControllerWithResult
- 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
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 27 |
# File 'lib/druzy/little_frame/file_chooser.rb', line 17 def notify_action(view,action,args={}) if action == :push_cross || action == :push_cancel view.close @model.result = :cancel elsif action == :push_open view.close @model.files = args[:files] @model.result = :open end end |