Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
15.3 Text Clipboard Functions
Both the Text widget and the TextField widget have convenience routines that support communication with the
clipboard. Using these functions, you can implement the standard cut, copy, and paste functionality, as well as support
communication with other windows or applications on the desktop. If you are not familiar with the clipboard and how
it works, see Chapter 17, The Clipboard. Briefly, the clipboard is one of three transient locations where arbitrary data
such as text can be stored so that other windows or applications can copy the data. For the Text widget, we are only
interested in copying textual data and providing visual feedback within the widget. The Text widget can send and
receive data from all three of the locations, depending on the interface style that you are using.
As described earlier in this chapter, the user typically selects text by pressing the first mouse button and dragging the
pointer across the text. When text is selected, it is rendered in reverse video and automatically copied into the primary
selection. Now the user can paste text from the primary selection into any Text widget on the desktop by pressing the
middle mouse button. The insertion cursor is moved to the location of the button press, and the data is automatically
copied into the Text widget at this position. This functionality works by default within the Text widget. However, the
actions operate on the primary selection, not the clipboard selection. Furthermore, the actions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431