NAME
carbon - commands
SYNOPSIS
package require carbon ?version?
DESCRIPTION
COMMANDS
carbon::dock cmd ?detail?
carbon::idle cmd ?detail?
carbon::process cmd ?detail?
carbon::sleep cmd ?detail?
carbon::systemui cmd ?switches...?
SEE ALSO
KEYWORDS

NAME

carbon - namespace that contains commands for the carbon package.

SYNOPSIS

package require carbon ?version?

DESCRIPTION

The carbon package creates the ::carbon namespace with Mac OS X (Aqua) only commands. See specific documentation for the commands.

COMMANDS

carbon::dock cmd ?detail?
Does various actions on the application dock icon.
Note: this code could be made much more flexible if integrated with the tkpath package.

bounce boolean
Starts or stops the dock icon bounces. If bouncing it stops automatically when clicked.

overlay -text string
Draws the string inside a green oval on top of the dock icon. An empty string removes the overlay.

carbon::idle cmd ?detail?
Notifier for idle actions, that is, when no user action made for a certain period of time. These are one-shot timers.
Note: on Mac OS X 10.2.8 this is unreliable.

add tclProc seconds
Adds a tcl procedure to be called when the system has been idle for seconds. It returns a token to be used as an identifier for this particular instance.

idlesecs
Returns the number of seconds the system has been idle.

info ?token?
If used without specifying a token, it returns all registered tokens. When token specified it returns a list tclProc seconds.

remove token
Removes and cancels the callback given by token.

carbon::process cmd ?detail?
It contains miscellaneous commands for obtaining process information and setting various process features.
current
Returns the process serial number of the current process.

info psn
Returns a list of key-value pairs of process information for the given process serial number.

forpid pid
Returns the process serial number of the process with the given pid.

front ?psn?
If no psn given it returns the process serial number of the front process. With given psn it activates the process of given process serial number and brings all its windows to the front (or only the frontmost window if the frontWindowOnly flag is set).

list
Returns a list of process serial numbers of all processes.

showhide psn boolean
Shows or hides the process of given process serial number, depending on the visible flag.

carbon::sleep cmd ?detail?
Notifier for system sleep events. These are one-shot timers.
add tclProc
Adds a tcl procedure to be called when a system sleep event occur. The tclProc gets called with a single argument which is any of: willsleep, sleep, wakeup, willrestart, willpoweroff. If the tclProc returns -code break then sleep can be delayed for 30 seconds for the sleep event.

sleep Idle sleep is about to kick in.

willsleep The system WILL go to sleep.

info ?token?
If used without specifying a token, it returns all registered tokens. When token specified it returns the tclProc.

remove token
Removes and cancels the callback given by token.

carbon::systemui cmd ?switches...?
Sets or gets the systems UI mode. Without any arguments it returns the current state. Note that the system UI mode is a per-process state. Switching from a process that is suppressing system UI to another process that is not will cause system UI elements to become visible automatically. Switching back to the first process will suppress system UI elements again. The modes are:

normal
In this mode, all standard system UI elements are visible.

contentsuppressed
In this mode, system UI elements which cover the "content area" of the screen (the area other than the menubar) are hidden. However, these elements may automatically show themselves in response to mouse movements or other user activity; specifically, the Dock will still show itself automatically when the mouse moves into the Dock's auto-show region.

contenthidden
In this mode, system UI elements which cover the "content area" of the screen (the area other than the menubar) are hidden. Unlike contentsuppressed, most UI elements will not automatically show themselves in this mode.

allhidden
In this mode, all system UI elements, including the menubar, are hidden. Most system UI elements will not automatically show themselves in this mode.
The switches. Note that you only supply the switches, and no values.

-autoshowmenubar
Requests that the menubar automatically show itself when the user moves the mouse into the screen area that would ordinarily be occupied by the menubar. Only valid with allhidden mode.

-disableapplemenu
Disables all items in the Apple menu. Valid for all modes.

-disableprocessswitch
The active application may not be changed while this process is active. Currently disables the Command-Tab and Command-Shift-Tab key sequences to switch the active process, and the global window rotation key sequence selected by the user in the Keyboard preference pane. Only valid with modes other than normal.

-disableforcequit
The Force Quit window may not be displayed while this process is active. Currently disables the Command-Option-Escape key sequence to open the Force Quit window and the Force Quit menu item in the Apple menu. Only valid with modes other than normal.

-disablesessionterminate
The current login session may not be terminated while this process is active. Currently disables the Power key and the Restart, Shut Down, and Log Out menu items in the Apple menu. Only valid with modes other than normal.

KEYWORDS

Carbon Aqua MacOSX
Copyright © 2006 Mats Bengtsson