Class: Shoes::Swt::Download
- Inherits:
-
Object
- Object
- Shoes::Swt::Download
- Defined in:
- shoes-swt/lib/shoes/swt/download.rb
Instance Attribute Summary collapse
-
#busy ⇒ Object
Returns the value of attribute busy.
Instance Method Summary collapse
-
#actually_run_block(blk, result) ⇒ Object
Why a separate method? So RedrawingAspect can target it!.
- #busy? ⇒ Boolean
-
#eval_block(blk, result) ⇒ Object
This exists to guarantee the callback block for download completion executes on the main UI thread.
-
#initialize(_dsl, _app) ⇒ Download
constructor
A new instance of Download.
Constructor Details
#initialize(_dsl, _app) ⇒ Download
Returns a new instance of Download.
7 8 9 |
# File 'shoes-swt/lib/shoes/swt/download.rb', line 7 def initialize(_dsl, _app) @busy = false end |
Instance Attribute Details
#busy ⇒ Object
Returns the value of attribute busy.
6 7 8 |
# File 'shoes-swt/lib/shoes/swt/download.rb', line 6 def busy @busy end |
Instance Method Details
#actually_run_block(blk, result) ⇒ Object
Why a separate method? So RedrawingAspect can target it!
20 21 22 23 |
# File 'shoes-swt/lib/shoes/swt/download.rb', line 20 def actually_run_block(blk, result) blk.call result @busy = false end |
#busy? ⇒ Boolean
25 26 27 |
# File 'shoes-swt/lib/shoes/swt/download.rb', line 25 def busy? @busy end |
#eval_block(blk, result) ⇒ Object
This exists to guarantee the callback block for download completion executes on the main UI thread. Without it we get thread access errors.
13 14 15 16 17 |
# File 'shoes-swt/lib/shoes/swt/download.rb', line 13 def eval_block(blk, result) ::Swt.display.asyncExec do actually_run_block(blk, result) end end |