Examples

Copy to Clipboard from Static Text

We want to make an application containing static text whose contents can be copied to the clipboard. A QuickTime movie of this example is available, as is the completed project for different platforms (Mac OS, Windows 3.1 or Windows 95/NT).

Create a project containing a layout file with a protoApp with a protoStaticText child. Build and download. Try to select some of the static text. You'll be unable to. Taps are ignored by the static text because the vClickable flag isn't set for the static text. Gestures are also ignored because the vGesturesAllowed flag isn't set.

Add a viewFlags slot to the static text. Modify the viewFlags turning on vClickable and vGesturesAllowed. Now build and download. When you hold your stylus down on the static text, you can select any or all of it. Dragging to the edge of the screen copies the text to the clipboard.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996