Sha256: bb17a2e7a891cd10977942146d2228396616561b23a444bacae6973b06901325

Contents?: true

Size: 666 Bytes

Versions: 9

Compression:

Stored size: 666 Bytes

Contents

module Tk
  module After
    module_function

    def ms(ms)
      if block_given?
        id = nil
        block = Proc.new

        wrap = lambda{|*args|
          block.call
          Tk.unregister_proc(id)
          true
        }

        id, command = Tk.register_proc(wrap, 'after_ms')
        Tk.execute_only(:after, ms, command)
      else
        Tk.execute_only(:after, ms)
      end
    end

    def idle(&block)
      id = nil
    
      wrap = lambda{|*args|
        block.call
        Tk.unregister_proc(id)
        true
      }

      id, command = Tk.register_proc(wrap, 'after_idle')
      Tk.execute_only(:after, :idle, command)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-tk-2010.08.23 lib/ffi-tk/command/after.rb
ffi-tk-2010.08 lib/ffi-tk/command/after.rb
ffi-tk-2010.06 lib/ffi-tk/command/after.rb
ffi-tk-2010.03 lib/ffi-tk/command/after.rb
ffi-tk-2010.02 lib/ffi-tk/command/after.rb
ffi-tk-2010.01 lib/ffi-tk/command/after.rb
ffi-tk-2010.01.02 lib/ffi-tk/command/after.rb
ffi-tk-2009.12.14 lib/ffi-tk/command/after.rb
ffi-tk-2009.11.29 lib/ffi-tk/command/after.rb