Sha256: c873183f0d18d4019da088018aa63ad1a918f71cf8405948608e017a9418a408

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 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
          actually_run_block(blk, result)
        end
      end

      # Why a separate method? So RedrawingAspect can target it!
      def actually_run_block(blk, result)
        blk.call result
        @busy = false
      end

      def busy?
        @busy
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre8 lib/shoes/swt/download.rb