Sha256: e83e87db9347ffd7af89128c545d18a3f29098cb9275dc3aa86ed855ec184711

Contents?: true

Size: 1.45 KB

Versions: 9

Compression:

Stored size: 1.45 KB

Contents

module Tk
  # Wait for variable to change or window to be destroyed
  #
  # This module provides blocking calls that wait for one of several things to
  # happen, then return without taking any other actions.
  #
  # The tkwait command waits for one of several things to happen, then it
  # returns without taking any other actions.
  # The return value is always nil.
  #
  # While the methods are waiting, events are processed in the normal fashion,
  # so the application will continue to respond to user interactions.
  # If an event handler invokes [Wait] methods again, the nested call must
  # complete before the outer call can complete.
  module Wait
    module_function

    # Waits for the variable called +name+ to be modified.
    def variable(name)
      Tk.execute_only(:tkwait, :variable, name)
    end

    # Takes the +name+ of a window and waits for a change in its visibility
    # state (as indicated by the arrival of a VisibilityNotify event).
    # Typically used to wait for a newly-created window to appear on the screen
    # before taking some action.
    def visibility(name)
      Tk.execute_only(:tkwait, :visibility, name)
    end

    # This method takes the name of a window as argument and waits until the
    # window is destroyed.
    # It is typically used to wait for a user to finish interacting with a
    # dialog box before using the result of that interaction.
    def window(name)
      Tk.execute_only(:tkwait, :window, name)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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