module Tk::Wait

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.

Public Instance Methods

variable(name) click to toggle source

Waits for the variable called name to be modified.

# File lib/ffi-tk/command/wait.rb, line 20
def variable(name)
  Tk.execute_only(:tkwait, :variable, name)
end
visibility(name) click to toggle source

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.

# File lib/ffi-tk/command/wait.rb, line 28
def visibility(name)
  Tk.execute_only(:tkwait, :visibility, name)
end
window(name) click to toggle source

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.

# File lib/ffi-tk/command/wait.rb, line 36
def window(name)
  Tk.execute_only(:tkwait, :window, name)
end