Sha256: b260cb1fe860ac98bc98fe59091cdd2ef9c1e4a30a60791479513bb4e57f615c

Contents?: true

Size: 492 Bytes

Versions: 3

Compression:

Stored size: 492 Bytes

Contents

class Shoes
  module Swt
    class Download
      attr_accessor :busy
      def initialize(_dsl, _app)
        @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

3 entries across 3 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre7 lib/shoes/swt/download.rb
shoes-swt-4.0.0.pre6 lib/shoes/swt/download.rb
shoes-swt-4.0.0.pre5 lib/shoes/swt/download.rb