Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  Basic Calculations /  One Thing after Another /

3.9 Active Elements in Notebooks

One of the most powerful features of Mathematica TE notebooks is that their actions can be programmed. Thus, for example, you can set up a button in a Mathematica TE notebook that causes various operations to be performed whenever you click it.

Here is a notebook that contains a button.

Clicking the button in this case causes the current date to be displayed.

Later on this book will discuss how you can set up buttons and other similar objects in Mathematica TE notebooks. But here suffice it to say that whenever a cell is indicated as active, typically by the presence of a stylized "A" in its cell bracket, clicking on active elements within the cell will cause actions that have been programmed for these elements to be performed.
It is common to set up palettes that consist of arrays of buttons. Sometimes such palettes appear as cells within a notebook. But more often, a special kind of separate notebook window is used, which can conveniently be placed on the side of your computer screen and used in conjunction with any other notebook.

Palettes consisting of arrays of buttons are often placed in separate notebooks.

In the simplest cases, the buttons in palettes serve essentially like additional keys on your keyboard. Thus, when you click a button, the character or object shown in that button is inserted into your notebook just as if you had typed it.

Here is a palette of Greek letters with buttons that act like additional keys on your keyboard.

Often, however, a button may contain a placeholder indicated by . This signifies that when you click the button, whatever is currently selected in your notebook will be inserted at the position of the placeholder.

The buttons here contain placeholders indicated by .

Here is a notebook with an expression selected.

Clicking the top left button in the palette wraps the selected expression with a square root.

Sometimes buttons that contain placeholders are programmed simply to insert a certain expression in your notebook. But more often, they will be programmed to evaluate the result, sending it as input to the Mathematica TE kernel.

These buttons are set up to perform algebraic operations.

Here is a notebook with an expression selected.

Clicking the top left button in the palette causes the selected expression to be simplified.

There are some situations in which it is convenient to have several placeholders in a single button. Your current selection is typically inserted at the position of the primary placeholder, indicated by . Additional placeholders may however be indicated by , and you can move to the positions of successive placeholders using TabKey.

Here is a palette containing buttons with several placeholders.

Here is an expression in a notebook.

Clicking the top left button in the palette inserts the expression in place of the .

You can move to the other placeholders using TabKey, and then edit them to insert whatever you want.