Sha256: 2a9a8e425002249455c3a4df6b40754e6a31ffad37d49a32582710d244fcbc04

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 Bytes

Contents

class Shoes
  module Swt
    class Download
      
      attr_accessor :busy
      def initialize(_dsl)
        @busy = false
      end

      # This exists to guarantee the callback block for download completion
      # executes on the main UI thread. Without it we get thread access errors.
      def eval_block(blk, result)
        ::Swt.display.asyncExec do
          blk.call result
          @busy = false
        end
      end

      def busy?
        @busy
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
shoes-swt-4.0.0.pre2 lib/shoes/swt/download.rb
shoes-4.0.0.pre1 lib/shoes/swt/download.rb