|
The selection and clipboard system of Etk
Detailed Description
Some functions to manipulate the clipboard and the selections.
The selection system is used to add copy/paste support to Etk widgets.
There are mainly two types of selections:
- The primary selection that is used to copy text when some text is selected, and to paste it when the middle-button of the mouse is clicked
- The clipboard selection that is the traditional copy/paste, used when the user presses CTRL+X/C/V
There is a third selection type called "secondary selection", but it is almost never used.
You will almost never have to use directly the etk_selection_*() functions, they are already used in existing widgets. However, you may have to use them if you are creating a new widget to add copy/paste support to it.
The following example shows how to add clipboard support to a widget:
Enumeration Type Documentation
The different types of selection.
- Enumerator:
-
ETK_SELECTION_PRIMARY |
The primary selection: used when a text is selected. Its content is traditionally pasted when the middle button of the mouse is pressed |
ETK_SELECTION_SECONDARY |
The secondary selection: almost never used |
ETK_SELECTION_CLIPBOARD |
The clipboard: used when Ctrl+X/C/V is pressed (traditional copy/paste) |
The different types of content of a selection.
- Enumerator:
-
ETK_SELECTION_TEXT |
The content of the selection is a text |
Function Documentation
Sets the text of the given selection.
- Parameters:
-
| selection | the selection type whose text should be set |
| text | the text to set |
Requests the text from a selection.
- Parameters:
-
| selection | the selection you want to request the text from |
| target | the widget that will receive the selection. When Etk receives the requested text from the selection, it will emit the signal "selection-received" to the widget target |
Clears the given selection.
- Parameters:
-
| selection | the selection to clear |
|
|