NotebookAction
NotebookAction [/W=winName ] keyword = value [, keyword = value ...]
The NotebookAction operation creates or modifies an "action" in a notebook. A notebook action is an object that executes commands when clicked.
See Notebooks for general information about notebooks.
NotebookAction returns an error if the notebook is open for read-only. See Notebook Read/Write Properties for further information.
Parameters
The parameters are in keyword =value format. Parameters are automatically limited to legal values before being applied to the notebook.
| bgRGB=(r, g, b) | Specifies the action background color. r , g and b specify the amount of red, green, and blue as integers from 0 to 65535. | ||||||||||||
| commands=str | Specifies the command string to be executed when clicking the action. For multiline commands, add a carriage return (\r) between lines. | ||||||||||||
| enableBGRGB=enable | Uses the background color specified by the bgRGB parameter (enable=1). Background color is ignored for enable=0. | ||||||||||||
| frame=f | Specifies the frame enclosing the action. | ||||||||||||
| |||||||||||||
| helpText=helpTextStr | Specifies the help string for the action. The text is limited to 255 bytes. Help appears in the status line when the cursor is over the action. | ||||||||||||
| ignoreErrors=ignore | Controls whether an error dialog will appear (ignore=0) or not (ignore is nonzero) if an error occurs while executing the action commands. | ||||||||||||
| linkStyle=linkStyle | Controls the text style of the action title. If linkStyle=1, the style is the same as a help link (blue underlined). If linkStyle=0, the style properties are the same as the preceding text. | ||||||||||||
| name=name | Specifies the name of the new or modified notebook action. This is a standard Igor name. See Standard Object Names for details. | ||||||||||||
| padding={leftPadding, rightPadding, topPadding, bottomPadding, internalPadding } | |||||||||||||
| Sets the padding in points. internalPadding sets the padding between the title and the picture when both elements are present. | |||||||||||||
| picture=name | Specifies a picture for the action icon. name is the name of a picture in the picture gallery (see Pictures). | ||||||||||||
| If name is null ($""), it clears the picture parameter. | |||||||||||||
| procPICTName=name | Specifies a Proc Picture for the action icon (see Proc Pictures). name is the name of a Proc Picture or null ($"") to clear it. This will be a name like ProcGlobal#myPictName or MyModuleName#myPictName. If you use a module name, the Proc Picture must be declared static. | ||||||||||||
| If you specify both picture and procPICTName, picture will be used. | |||||||||||||
| quiet=quiet | Displays action commands in the history area (quiet =0), otherwise (quiet =1) no commands will be recorded. | ||||||||||||
| scaling={h, v} | Scales the picture in percent horizontally, h, and vertically, v. | ||||||||||||
| showMode=mode | Determines if the title or picture are displayed. | ||||||||||||
| |||||||||||||
| Without a picture specification, the action will use title mode regardless of what you specify. | |||||||||||||
| title=titleStr | Sets the action title to titleStr, which is limited to 255 bytes. | ||||||||||||
Flags
| /W= winName | Specifies the notebook window of interest. | |
| winName is either kwTopWin for the top notebook window, the name of a notebook window or a host-child specification (an hcSpec) such as Panel0#nb0. See Subwindow Syntax for details on host-child specifications. | ||
| If /W is omitted, NotebookAction acts on the top notebook window. | ||
Examples
String nb = WinName(0, 16, 1) // Top visible notebook
NotebookAction name=Action0, title="Beep", commands="Beep" // Create action
NotebookAction name=Action0, enableBGRGB=1, padding={4,4,4,4,4}
Notebook $nb, findSpecialCharacter={"Action0",1} // Select action
Notebook $nb, frame=1 // Set frame
See Also
Notebook, NewNotebook, OpenNotebook
SpecialCharacterList, SpecialCharacterInfo