send chan value
tk window title [ args... ]
tk winctl winid cmd
tk wintitle winid title
tk namechan chan [ name ]
tk del name
tk winid tkcmd
${tk window title [ args... ] }
${tk onscreen winid [ how ] }
${tk winid tkcmd }
${recv chan }
${alt chan ... }
10 chan For each name in turn, chan creates a new channel called name within the tk module. Name henceforth represents a Limbo chan of string and can be used to send string values between sh processes running in parallel. A chan is also used to receive events arriving from the window manager. It is illegal to create a channel whose name consists entirely of numeric digits.
send Send sends its argument value down the channel chan , blocking until a corresponding receive operation takes place on the channel.
tk window Tk window creates a new top-level window with the text of title in the titlebar at the top. Each window created by the tk module is assigned a unique numeric id. This id is printed by this command; to get access to the value of the winid in a script, use "${tk window}" . All the remaining arguments are joined together by spaces and passed as the tk options for the window. When a window is created, a corresponding channel of the same name is created. Events from the window manager arrive on this channel, and should be responded to appropriately using "tk winctl" .
tk onscreen Tk onscreen must be called to make window winid visible for the first time, the same as onscreen in tkclient (2). How is the same as for that call - if given, it must be one of place , onscreen or exact .
tk winctl Tk winctl is used to communicate requests to the window manager. (see winctl() in wmlib (2)). If an event arriving on a window's channel is passed to "tk winctl" , a suitable default action will take place. The set of possible actions include:
exit A request to close the window.
size A request to resize the window.
task A request to miniaturise the window.
move A request to move the window.
tk wintitle Tk wintitle changes the title of the window winid to title .
tk del Tk del deletes a channel or a window. If name is the winid of an existing window, then both the window and its associated channel are destroyed. A del of a non-existent channel or window is ignored.
tk namechan Tk namechan invokes the Tk module's namechan() function to give a tk name to a channel within the tk module. If name is omitted, then the tk name given will be the same as chan .
tk winid If winid is the id of an existing window, the rest of the arguments joined together by spaces and sent as a tk command to be interpreted in that window. If the shell is in interactive mode, then the string returned by tk will be printed. The exit status of tk is false if the string returned by tk begins with a bang ( ! ) character.
${tk window} Tk window is the same as its command counterpart, except that it yields the winid of the newly created window rather than printing it.
${tk winid } This command is the same as its command counterpart, except that it yields the return value from the Tk command as its result.
${recv} Recv receives a string value from chan and yields that value. It will block until a corresponding send operation takes place on the channel.
${alt} Alt waits until a value is available on any of the named chan s. It yields a list containing two elements, the name of the channel from which the value was received, and the actual value received.