| Search Locate Previous Next | Contents |
Perhaps the simplest example of an APL expression with an obvious visual presence is a text vector in an edit field:
Here I have assigned a value to the variable name, and set it as the data to watch of a text edit field. Anything the user types into the field is reflected back into the variable as soon as he/she leaves the field, for example by hitting the <Tab> key or pressing the <Close> button with the mouse. In the example, I have added a <Flip> button which executes the APL fragment name²name and the edit field is redrawn immediately when the variable is assigned.
You can experiment with the Causeway designer to produce this simple dialogue load the workspace, and type:
name'Adrian Smith' Dbx 'dbx.flip'
Use the right mouse button for a menu of possible new objects, and choose Text objects>Text entry from the menu.
Set its caption as Name, and then use the right button to get a menu of properties for the text object. Choose Text to associate it with the correct variable:
We shall see later that there are more possibilities than just the plain variable name in the top-left field. The right-hand field lists all the dependencies, in this case just the variable itself. Simply tab across to it to have Causeway make the obvious guess and fill in the dependency for you. The gui object will now be automatically redrawn when any other object changes the variable called name. The two lower fields can usually be left to default they show you what will happen when the user changes the data in the gui object and Causeway must update the underlying data with the new values. In this case the variable is simply assigned the field content (represented here as omega) and the change to the variable is notified so that any other gui objects which list name in their dependencies will be redrawn.