Cut, copy and paste

gtkscintilla.Scintilla.cut()
gtkscintilla.Scintilla.copy()
gtkscintilla.Scintilla.paste()
gtkscintilla.Scintilla.clear()
gtkscintilla.Scintilla.can_paste()
gtkscintilla.Scintilla.copy_allow_line()

These commands perform the standard tasks of cutting and copying data to the clipboard, pasting from the clipboard into the document, and clearing the document. can_paste() returns True if the document isn’t read-only and if the selection doesn’t contain protected text. If you need a “can copy” or “can cut”, use get_selection_start() get_selection_end(), which will be non-zero if you can copy or cut to the clipboard.

Warning

GTK+ does not really support can_paste() and always returns True unless the document is read-only.

Warning

On X, the clipboard is asynchronous and may require several messages between the destination and source applications. Data from paste() will not arrive in the document immediately.

gtkscintilla.Scintilla.copy_allow_line() works the same as copy() except that if the selection is empty then the current line is copied.

gtkscintilla.Scintilla.copy_range(start, end)
gtkscintilla.Scintilla.copy_text(text)

copy_range() copies a range of text from the document to the system clipboard and gtkscintilla.Scintilla.copy_text() copies a supplied piece of text to the system clipboard.

Previous topic

Text retrieval and modification

Next topic

Undo and Redo

This Page