gtk.TextView — a widget that displays the contents of a gtk.TextBuffer
|
|
gtk.Container Signal Prototypes
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( |
A gtk.TextView
widget provides the display for the contents of a gtk.TextBuffer
object. A textview provides a set of attributes for the default display of
text from a textbuffer. The attributes set by gtk.TextTag
objects
override the attributes set on a gtk.TextView
widget. Since a gtk.TextBuffer
can be associated with multiple gtk.TextView
widgets each having a different set of default attributes, the display of
the same text in different textview widgets can be quite different except
for those attributes that are overridden by texttags.
A gtk.TextView
widget has several gtk.gdk.Window
widgets most of which are not displayed by default:
| The widget window |
| The window that holds the text |
| The left border window - not displayed by default |
| The right border window - not displayed by default |
| The top border window - not displayed by default |
| The bottom border window - not displayed by default |
| An internal inaccessible gtk.gdk.Window |
The border windows are not created until they are given a size by
using the set_border_window_size
()
method.
Depending on the wrap mode of the textview a textbuffer line may be displayed as more than one screen display line. The textview has methods to navigate through the display lines.
A gtk.TextChildAnchor
in a gtk.TextBuffer
provides a place for a PyGTK
widget to be placed in a
gtk.TextView
. Each
textview displaying the same textbuffer with a child anchor must have a
different widget placed at that child anchor. In addition, a widget can be
placed at a specific location in one of the above gtk.TextView
windows using the add_child_in_window
()
method. The widget will be clipped to the window boundaries if it is larger
than the window or located where it extends beyond the window
boundaries.
A gtk.TextView
has a
default popup menu that includes the usual cut, copy and paste
capabilities. In PyGTK 2.2 gtk.Clipboard
objects are supported so your program can access the contents of the cut,
copy and paste clipboard through the
gdk.SELECTION_CLIPBOARD
clipboard. Also the selected text
in a gtk.TextView
is
available on the gdk.SELECTION_PRIMARY
clipboard.
gtk.TextView(buffer
=None)
| a gtk.TextBuffer
or None |
Returns : | a new gtk.TextView . |
Creates a new gtk.TextView
widget displaying the gtk.TextBuffer
specified by buffer
. If buffer
is None
, a new gtk.TextBuffer
will be created. One textbuffer can be shared among many widgets.
def set_buffer(buffer
)
| a gtk.TextBuffer |
The set_buffer
() method sets the gtk.TextBuffer
specified by buffer
as the textbuffer being displayed
by the textview.
def get_buffer()
Returns : | a gtk.TextBuffer |
The get_buffer
() method returns the
gtk.TextBuffer
being displayed by this textview.
def scroll_to_iter(iter
, within_margin
, use_align
=False, xalign
=0.5, yalign
=0.5)
| a gtk.TextIter
object |
| the margin as a [0.0,0.5) fraction of screen size |
| if True use the alignment
arguments; if False , just get iter
on screen |
| the horizontal alignment of
iter within visible area. |
| the vertical alignment of
iter within visible area |
Returns : | True if scrolling
occurred |
The scroll_to_iter
() method scrolls the
textview so that the gtk.TextIter
location specified by iter
is on the screen in the
position indicated by xalign
and
yalign
. If use_align
is
True
the alignments specify the fraction of screen space
to the left of or above the location of iter
. If
use_align
is False
, the text
scrolls the minimal distance to get iter
on screen,
possibly not scrolling at all. The effective screen for purposes of this
method is reduced by a margin of size specified by
within_margin
.
This method uses the currently-computed height of the lines in
the text buffer. The line heights are computed in an idle handler so this
method may not have the desired effect if it's called before the height
computations are complete. To avoid oddness, consider using the scroll_to_mark
()
method that saves a point to be scrolled to after line validation.
def scroll_to_mark(mark
, within_margin
, use_align
=False, xalign
=0.5, yalign
=0.5)
| a gtk.TextMark
object |
| the margin as a [0.0,0.5) fraction of screen size |
| if True use the alignment
arguments; if False , just get mark
on screen |
| the horizontal alignment of
mark within the visible area. |
| the vertical alignment of
mark within the visible area |
The scroll_to_mark
() method scrolls the
textview so that the gtk.TextMark
location specified by mark
is on the screen in the
position specified by xalign
and
yalign
. If use_align
is
True
the alignments specify the fraction of screen space
to the left of or above the location of mark
. If
use_align
is False
, the text
scrolls the minimal distance to get mark
on screen,
possibly not scrolling at all. The effective screen for purposes of this
function is reduced by a margin of size specified by
within_margin
.
def scroll_mark_onscreen(mark
)
| a gtk.TextMark in
the textbuffer for textview |
The scroll_mark_onscreen
() method
scrolls the textview the minimum distance to place the gtk.TextMark
location specified by mark
within the visible area of
the widget.
def move_mark_onscreen(mark
)
| a gtk.TextMark
object |
Returns : | True if
mark moved (wasn't already
on screen) |
The move_mark_onscreen
() moves the
gtk.TextMark
location specified by mark
to a location within the
currently-visible text area of the textview.
def place_cursor_onscreen()
Returns : | True if the cursor had to be moved. |
The place_cursor_onscreen
() method
moves the cursor to a new location within the currently visible region of
the buffer, if it isn't there already.
def get_visible_rect()
Returns : | a gtk.gdk.Rectangle |
The get_visible_rect
() method returns a
gtk.gdk.Rectangle
containing the coordinates of the currently-visible region of the buffer.
The rectangle is in buffer coordinates that can be converted to window
coordinates with the buffer_to_window_coords
()
method.
def set_cursor_visible(setting
)
| if True show the insertion
cursor |
The set_cursor_visible
() method sets
the "cursor-visible" property to the value of
setting
. If setting
is
True
the cursor is visible; if False
,
it is not. A buffer with no editable text probably shouldn't have a visible
cursor, so you may want to turn the cursor off.
def get_cursor_visible()
Returns : | True if the insertion mark
is visible |
The get_cursor_visible
() method returns
the value of the "cursor-visible" property that determines if the insertion
point is visible.
def get_iter_location(iter
)
| a gtk.TextIter |
Returns : | a gtk.gdk.Rectangle
containing the bounds of the character at
iter |
The get_iter_location
() method returns
a gtk.gdk.Rectangle
that contains the character at the location specified by
iter
. The rectangle position is in buffer coordinates
that can be converted to window coordinates with the buffer_to_window_coords
()
method.
def get_iter_at_location(x
, y
)
| x position, in buffer coordinates |
| y position, in buffer coordinates |
Returns : | a gtk.TextIter |
The get_iter_at_location
() method
returns a gtk.TextIter
that
points at the location specified by the buffer coordinates
x
and y
. Buffer coordinates
are coordinates for the entire buffer, not just the currently-displayed
portion. Window coordinates from an event, must be converted to buffer
coordinates with the window_to_buffer_coords
()
method before using them with this method.
def get_line_yrange(iter
)
| a gtk.TextIter |
Returns : | a tuple containing a y coordinate and a height |
The get_line_yrange
() method locates
the line containing the gtk.TextIter
specified by iter
and returns a tuple containing the
y coordinate of the top of the line and the height of the line. The
coordinate is a buffer coordinate that can be converted to window
coordinates with the buffer_to_window_coords
()
method.
def get_line_at_y(y
)
| a y coordinate |
Returns : | a tuple containing a gtk.TextIter
pointing at the line start and the top coordinate of the
line |
The get_line_at_y
() method returns a
tuple containing:
gtk.TextIter
pointing at the start of the line with the vertical coordinate specified by
y
and,y
is in buffer coordinates that can be
converted from window coordinates with the window_to_buffer_coords
()
method.
def buffer_to_window_coords(win
, buffer_x
, buffer_y
)
| one of the textview windows except
gtk.TEXT_WINDOW_PRIVATE |
| buffer x coordinate |
| buffer y coordinate |
Returns : | a tuple containing the window x and y coordinates |
The buffer_to_window_coords
() method
returns a tuple containing the x and y coordinates for the window specified
by win
that correspond to the textbuffer coordinates
specified by buffer_x
and
buffer_y
. See the above description for more details on
textview window types.
You can't convert coordinates for a non-existing window (see
the set_border_window_size
()
method).
def window_to_buffer_coords(win
, window_x
, window_y
)
| a textview window except
gtk.TEXT_WINDOW_PRIVATE |
| window x coordinate |
| window y coordinate |
Returns : | a tuple containing the textbuffer x and y coordinates |
The window_to_buffer_coords
() method
returns a tuple containing the textbuffer x and y coordinates corresponding
to the window_x
and window_y
coordinates in the window specified by win
, See the
above description for more
details on textview window types.
You can't convert coordinates for a non-existing window (see
the set_border_window_size
())
method.
def get_window(win
)
| a textview window type |
Returns : | a gtk.gdk.Window , or
None |
The get_window
() method returns the
gtk.gdk.Window
corresponding to an area of the textview specified by
win
:
| The widget window |
| The window that holds the text |
| The left border window - not displayed by default |
| The right border window - not displayed by default |
| The top border window - not displayed by default |
| The bottom border window - not displayed by default |
| An internal inaccessible gtk.gdk.Window |
This method returns None
if the window is
nonexistent i.e. if its width or height is 0.
def get_window_type(window
)
| a window type |
Returns : | the window type. |
The get_window_type
() method returns
the type of the gtk.gdk.Window
specified by window
. This method is used to find out
what window type an event corresponds to. If you connect to an event signal
on the textview, this method can be called on
event.window
to see what window type it was. See the
get_window
()
method for more details on window types.
def set_border_window_size(type
, size
)
| a textview border window type |
| the width or height of the window |
The set_border_window_size
() method
sets the width of a gtk.TEXT_WINDOW_LEFT
or
gtk.TEXT_WINDOW_RIGHT
window, or the height of a
gtk.TEXT_WINDOW_TOP
or
gtk.TEXT_WINDOW_BOTTOM
window. This method automatically
destroys the corresponding window if the size is set to 0, and creates the
window if the size is set to non-zero. This method can only be used for the
"border windows", it doesn't work with the
gtk.TEXT_WINDOW_WIDGET
,
gtk.TEXT_WINDOW_TEXT
, or
gtk.TEXT_WINDOW_PRIVATE
windows.
def get_border_window_size(type
)
| a textview border window type |
Returns : | the width or height of the textview border window |
The get_border_window_size
() method
returns the width or height of the border window of the type specified by
type
. See the set_border_window_size
()
method for more details.
def forward_display_line(iter
)
| a gtk.TextIter |
Returns : | True if
iter was moved and is not on the end
iterator |
The forward_display_line
() method moves
the location of iter
forward by one display line. A
textview display line is different from a textbuffer line. Textbuffer lines
are paragraphs and are separated by newlines or other paragraph separator
characters. Display lines are created by line-wrapping a textbuffer line. If
wrapping is turned off, display lines and textbuffer lines will be the same.
Display lines are divided differently for each textview, since they depend
on the textview's width and the textview's default wrap mode. Paragraphs are
the same in all views, since they depend on the contents of the gtk.TextBuffer
.
This method returns True
if the location of
iter
moves to a dereferenceable position (i.e. not
the end position).
def backward_display_line(iter
)
| a gtk.TextIter |
Returns : | True if
iter was moved |
The backward_display_line
() method
moves the location of iter
backward by one display
line. A textview display line is different from a textbuffer line. Textview
lines are paragraphs and are separated by newlines or other paragraph
separator characters. Display lines are created by line-wrapping a
textbuffer line. If wrapping is turned off, display lines and textbuffer
lines will be the same. Display lines are divided differently for each
textview, since they depend on the textview's width and the textview's
default wrap mode. Paragraphs are the same in all views, since they depend
on the contents of the gtk.TextBuffer
.
This method returns True
if the location of
iter
moves to a dereferenceable position (i.e. not
the end position).
def forward_display_line_end(iter
)
| a gtk.TextIter |
Returns : | True if
iter was moved and is not on the end
iterator |
The forward_display_line_end
() method
moves the location of iter
forward to the next
display line end. A textview display line is different from a textbuffer
line. Textbuffer lines are paragraphs and are separated by newlines or other
paragraph separator characters. Display lines are created by line-wrapping a
textbuffer line. If wrapping is turned off, display lines and textbuffer
lines will be the same. Display lines are divided differently for each
textview, since they depend on the textview's width and the textview's
default wrap mode. Paragraphs are the same in all views, since they depend
on the contents of the gtk.TextBuffer
.
This method returns True
if the location of
iter
moves to a dereferenceable position (i.e. not
the end position).
def backward_display_line_start(iter
)
| a gtk.TextIter |
Returns : | True if
iter was moved |
The backward_display_line_start
()
method moves the location of iter
backward to the
next display line start. A textview display line is different from a
textbuffer line. Textbuffer lines are paragraphs and are separated by newlines
or other paragraph separator characters. Display lines are created by
line-wrapping a textbuffer line. If wrapping is turned off, display lines
and textbuffer lines will be the same. Display lines are divided differently
for each textview, since they depend on the textview's width and the
textview's default wrap mode. Paragraphs are the same in all views, since
they depend on the contents of the gtk.TextBuffer
.
This method returns True
if the location of
iter
moves to a dereferenceable position (i.e. not
the end position).
def starts_display_line(iter
)
| a gtk.TextIter |
Returns : | True if the location of
iter is at the beginning of a display
line |
The starts_display_line
() method
returns True
if the location of
iter
is at the start of a display line. See the forward_display_line
()
method for an explanation of display lines vs. textbuffer lines
(paragraphs).
def move_visually(iter
, count
)
| a gtk.TextIter |
| the number of characters to move (may be negative) |
Returns : | True if
iter moved and is not on the end
iterator |
The move_visually
() method moves the
location of iter
by count
cursor positions. If count is negative the location moves against the
normal text direction. Note a cursor position move may move over multiple
characters when multiple characters combine to form one grapheme.
def add_child_at_anchor(child
, anchor
)
| a gtk.Widget |
| a gtk.TextChildAnchor
in the textview's gtk.TextBuffer |
The add_child_at_anchor
() method adds
the widget specified by child
in the textview, at the
gtk.TextChildAnchor
specified by anchor
.
def add_child_in_window(child
, which_window
, xpos
, ypos
)
| a gtk.Widget |
| the textview window
child should appear in |
| the X position of child
in window coordinates |
| the Y position of child
in window coordinates |
The add_child_in_window
() method adds
the widget specified by child
at the fixed
coordinates specified by xpos
and
ypos
in one of the text widget's windows specified by
which_window
. The window must have nonzero size (see
the set_border_window_size
()
method).
The child
coordinates are given
relative to the gtk.gdk.Window
specified by which_window
, and these coordinates have
no sane relationship to scrolling. When placing child
in a gtk.TEXT_WINDOW_WIDGET
window, scrolling is
irrelevant, child
floats above all scrollable areas.
However, placing child
in one of the scrollable
windows (a border windows or the text window), you'll need to compute the
correct position of child
in textbuffer coordinates
any time scrolling occurs or textbuffer changes occur, and then call the
move_child
()
method to update the child's position. Unfortunately there's no good way to
detect that scrolling has occurred, using the current API; a possible hack
would be to update all child positions when the scroll adjustments change or
the text buffer changes.
def move_child(child
, xpos
, ypos
)
| a child widget in the textview |
| the new X position in window coordinates |
| the new Y position in window coordinates |
The move_child
() method moves the
position of child
to the location (in its current
window) specified by xpos
and
ypos
.
def set_wrap_mode(wrap_mode
)
| a wrap mode value |
The set_wrap_mode
() method sets the
"wrap-mode" property of the textview to the value specified by
wrap_mode
. The value of wrap_mode can be one of:
gtk.WRAP_NONE
, gtk.WRAP_CHAR
, gtk.WRAP_WORD
or gtk.WRAP_WORD_CHAR
. The "wrap-mode" property defines the wrap
mode for text that is not influenced by a gtk.TextTag
that
sets its "wrap_mode" attribute.
def get_wrap_mode()
Returns : | the line wrap setting |
The get_wrap_mode
() method returns the
value of the "wrap-mode" property. The value of "wrap-mode" can be one of:
gtk.WRAP_NONE
, gtk.WRAP_CHAR
or
gtk.WRAP_WORD
. The "wrap-mode" property defines the wrap
mode for text that is not influenced by a gtk.TextTag
that
sets its "wrap_mode" attribute.
def set_editable(setting
)
| if True the text is editable
by default |
The set_editable
() method sets the
"editable" property to the value of setting
. If
setting
is True
the text in
textview is editable by default. The "editable" property determines the
editability of the gtk.TextView
text
that is not influenced by a gtk.TextTag
that
sets its "editable" attribute.
def get_editable()
Returns : | True if text is editable
by default |
The get_editable
() method returns the
value of the "editable" property. The "editable" property determines the
editability of the gtk.TextView
text
that is not influenced by a gtk.TextTag
that
sets its "editable" attribute.
def set_overwrite(overwrite
)
| if True turn on overwrite
mode; if False turn it off |
This method is available in PyGTK 2.4 and above.
The set_overwrite
() method sets the
"overwrite" property to the value of overwrite
. If
overwrite
is True
, inserted text
overwrites the existing text.
def get_overwrite()
Returns : | True if the textview is in
overwrite mode |
This method is available in PyGTK 2.4 and above.
The get_overwrite
() method returns the
value of the "overwrite" property. see the set_overwrite
()
method for more information.
def set_accepts_tab(accepts_tab
)
| if True pressing the
Tab key should insert a tab character; if
False , pressing the Tab key
should move the keyboard focus. |
This method is available in PyGTK 2.4 and above.
The set_accepts_tab
() method sets the
"accepts_tab" property to the value of
accepts_tab
. If accepts_tab
is
True
a tab character is inserted. If
accepts_tab
is False
the keyboard
focus is moved to the next widget in the focus chain.
def get_accepts_tab()
Returns : | True if pressing the
Tab key inserts a tab character,
False if pressing the Tab key
moves the keyboard focus. |
This method is available in PyGTK 2.4 and above.
The get_accepts_tab
() method returns
the value of the "accepts_tab" property. See the set_accepts_tab()
method for more information.
def set_pixels_above_lines(pixels_above_lines
)
| the number of pixels above paragraphs |
The set_pixels_above_lines
() method
sets the "pixels-above-lines" property to the value of
pixels_above_lines
. The "pixels-above-lines" property
determines the number of blank pixels to place above textbuffer lines
(paragraphs) in the textview for text that is not influenced by a gtk.TextTag
that
sets its "pixels-above-lines" attribute.
def get_pixels_above_lines()
Returns : | the default number of pixels above paragraphs |
The get_pixels_above_lines
() method
returns the value of the "pixels-above-lines" property. The
"pixels-above-lines" property determines the number of pixels to put above
textbuffer lines (paragraphs) in the textview for text that is not
influenced by a gtk.TextTag
that
sets its "pixels-above-lines" attribute.
def set_pixels_below_lines(pixels_below_lines
)
| the default number of pixels below paragraphs |
The set_pixels_below_lines
() method
sets the "pixels-below-lines" property to the value of
pixels_below_lines
. The "pixels-below-lines" property
determines the number of blank pixels to place below textbuffer lines
(paragraphs) in the textview for text that is not influenced by a gtk.TextTag
that
sets its "pixels-below-lines" attribute.
def get_pixels_below_lines()
Returns : | the default number of blank pixels below paragraphs |
The get_pixels_below_lines
() method
returns the value of the "pixels-below-lines" property. The
"pixels-below-lines" property determines the number of pixels to put below
textbuffer lines (paragraphs) in the textview for text that is not
influenced by a gtk.TextTag
that
sets its "pixels-below-lines" attribute.
def set_pixels_inside_wrap(pixels_inside_wrap
)
| the default number of pixels between wrapped lines |
The set_pixels_inside_wrap
() method
sets the "pixels-inside_wrap" property to the value of
pixels_inside_wrap
. The "pixels-inside_wrap" property
determines the number of blank pixels to place between wrapped textbuffer
lines (inside paragraphs) for text that is not influenced by a gtk.TextTag
that
sets its "pixels-inside_wrap" attribute.
def get_pixels_inside_wrap()
Returns : | the default number of pixels of blank space between wrapped lines |
The get_pixels_inside_wrap
() method
returns the value of the "pixels-inside-wrap" property. The
"pixels-inside-wrap" property determines the number of pixels to put between
wrapped textbuffer lines (inside paragraphs) for text that is not influenced
by a gtk.TextTag
that
sets its "pixels-inside-wrap" attribute.
def set_justification(justification
)
| the text justification |
The set_justification
() method sets the
"justification" property to the value of
justification
. The value of justification must be one
of: gtk.JUSTIFY_LEFT
,
gtk.JUSTIFY_RIGHT
, gtk.JUSTIFY_CENTER
or gtk.JUSTIFY_FILL
. The "justification" property
determines the justification of text in the textview that is not influenced
by a gtk.TextTag
that
set its "justification" attribute.
def get_justification()
Returns : | the default justification |
The get_justification
() method returns
the value of the "justification" property. the default justification of
paragraphs in text_view
. The value of "justification"
must be one of: gtk.JUSTIFY_LEFT
,
gtk.JUSTIFY_RIGHT
, gtk.JUSTIFY_CENTER
or gtk.JUSTIFY_FILL
. The "justification" property
determines the justification of text in the textview that is not influenced
by a gtk.TextTag
that
set its "justification" attribute.
def set_left_margin(left_margin
)
| the default left margin in pixels |
The set_left_margin
() method sets the
"left-margin" property to the value of left_margin
.
The "left-margin"property determines the number of pixels of space for the
left margin of text that is not influenced by a gtk.TextTag
that
sets its "left_margin" attribute.
def get_left_margin()
Returns : | the default left margin in pixels |
The get_left_margin
() method returns
the value of the "left_margin" property. The "left-margin"property
determines the number of pixels of space for the left margin of text that
is not influenced by a gtk.TextTag
that
sets its "left_margin" attribute.
def set_right_margin(right_margin
)
| the default right margin in pixels |
The set_right_margin
() method sets the
"right-margin" property to the value of right_margin
.
The "right-margin"property determines the number of pixels of space for the
right margin of text that is not influenced by a gtk.TextTag
that
sets its "right_margin" attribute.
def get_right_margin()
Returns : | the default right margin in pixels |
The get_right_margin
() method returns
the value of the "right_margin" property. The "right-margin"property
determines the number of pixels of space for the right margin of text that
is not influenced by a gtk.TextTag
that
sets its "right_margin" attribute.
def set_indent(indent
)
| the default indentation in pixels |
The set_indent
() method sets the
"indent" property to the value of indent
. The
"indent" property determines the indentation for textview paragraphs that
are not influenced by a gtk.TextTag
that
sets its "indent" attribute. The indentation may be negative.
def get_indent()
Returns : | the default number of pixels of indentation |
The get_indent
() method returns the
value of the "indent" property. The "indent" property determines the
indentation for textview paragraphs that are not influenced by a gtk.TextTag
that
sets its "indent" attribute. The indentation may be negative.
def set_tabs(tabs
)
| the default tabs as a pango.TabArray |
The set_tabs
() method sets the "tabs"
property to a copy of the value of tabs
. The "tabs"
property contains the custom tab stops for the textview paragraphs that are
not influenced by a gtk.TextTag
that
sets its "tabs" attribute.
def get_tabs()
Returns : | a copy of default tab array, or
None if "standard" tabs are used |
The get_tabs
() method returns the value
of the "tabs" property. The "tabs" property contains the custom tab stops
for the textview paragraphs that are not influenced by a gtk.TextTag
that
sets its "tabs" attribute. The returned value will be
None
if "standard" (8-space) tabs are used.
def get_default_attributes()
Returns : | a new gtk.TextAttributes |
The get_default_attributes
() method
returns a copy of the default gtk.TextAttributes
.
These attributes are used for text unless the text is influenced by a gtk.TextTag
.
You'd typically pass the default attributes in to the gtk.TextIter.get_attributes
()
method to get the attributes in effect at a given text position.
def callback(textview
, user_param1
, ...
)
| the object which received the signal. |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
This signal is available in GTK+ 2.10 and above.
The "backspace" signal is emitted when the Backspace key is pressed.
def callback(textview
, user_param1
, ...
)
| the textview that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "copy-clipboard" signal is emitted when a selection is
copied to the clipboard from textview
.
def callback(textview
, user_param1
, ...
)
| the textview that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "cut-clipboard" signal is emitted when a selection is cut
from textview
to the clipboard.
def callback(textview
, delete_type
, count
, user_param1
, ...
)
| the textview that received the signal |
| the type of deletion |
| the number of deletions to do |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "delete-from-cursor" signal is emitted when a deletion of
the type specified by delete_type
is initiated by
user action (e.g. pressing the Delete or
Backspace keys). The value of
delete_type
must be one of:
gtk.DELETE_CHARS
gtk.DELETE_WORD_ENDS
gtk.DELETE_WORDS
gtk.DELETE_DISPLAY_LINES
gtk.DELETE_DISPLAY_LINE_ENDS
gtk.DELETE_PARAGRAPH_ENDS
gtk.DELETE_PARAGRAPHS
gtk.DELETE_WHITESPACE
count
specifies the number of times that
deletion should be applied.
def callback(textview
, string
, user_param1
, ...
)
| the textview that received the signal |
| the text to be inserted |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "insert-at-cursor" signal is emitted when
string
is being inserted in
textview
.
def callback(textview
, step_size
, count
, extend_selection
, user_param1
, ...
)
| the textview that received the signal |
| the step size to move |
| the number of steps to move |
| if True extend the
selection |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "move-cursor" signal is emitted when the cursor is moved by
count
steps of step_size
. If
extend_selection
is True
the
selection is extended by the cursor movement. The value of step_size must be
one of:
| move by graphemes |
| move by graphemes |
| move by words |
| move by lines(wrapped lines) |
| move to line ends(wrapped lines) |
| move by paragraphs(newline-ended lines) |
| move to ends of a paragraph |
| move by pages |
| move to ends of the buffer |
def callback(textview
, direction
, user_param1
, ...
)
| the textview that received the signal |
| the direction to move the focus |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "move-focus" signal is emitted when the focus moves from
textview
in the direction specified by
direction
that must be one of:
gtk.DIR_TAB_FORWARD
,
gtk.DIR_TAB_BACKWARD
, gtk.DIR_UP
,
gtk.DIR_DOWN
, gtk.DIR_LEFT
or
gtk.DIR_RIGHT
def callback(textview
, scrollstep
, count
, user_param1
, ...
)
| the textview that received the signal |
| the size of the scroll step:
gtk.SCROLL_STEPS ,
gtk.SCROLL_PAGES ,
gtk.SCROLL_ENDS ,
gtk.SCROLL_HORIZONTAL_STEPS ,
gtk.SCROLL_HORIZONTAL_PAGES or
gtk.SCROLL_HORIZONTAL_ENDS |
| the number of scroll steps of size
scrollstep to take |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
This signal is available in GTK+ 2.4 and above.
The "move-viewport" signal is emitted when the viewport is being moved usually as the result of user action in moving the cursor or using the scrollbars.
def callback(textview
, count
, extend_selection
, user_param1
, ...
)
| the textview that received the signal |
| the number of pages to move |
| if True extend the
selection |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "page-horizontally" signal is emitted when user initiates horizontal paging by pressing one of the key combinations:
Control+Page Up | Page horizontally with
extend_selection set to
False |
Shift+Control+Page Up | Page horizontally with
extend_selection set to
True |
def callback(textview
, user_param1
, ...
)
| the textview that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "paste-clipboard" signal is emitted when the contents of the
clipboard are pasted into textview
.
def callback(textview
, menu
, user_param1
, ...
)
| the textview that received the signal |
| the menu to populate |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "populate-popup" signal is emitted when the popup menu
(specified by menu
) associated with
textview
needs to be populated.
def callback(textview
, select
, user_param1
, ...
)
| the textview that received the signal |
| if True select the buffer
contents; otherwise deselect the buffer
contents |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
This signal is available in GTK+ 2.2 and above.
The "select-all" signal is emitted when the user presses one of:
def callback(textview
, user_param1
, ...
)
| the textview that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "set-anchor" signal is emitted when an application calls the
GObject.emit()
()
def callback(textview
, hadjustment
, vadjustment
, user_param1
, ...
)
| the textview that received the signal |
| the horizontal adjustment |
| the vertical adjustment |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "set-scroll-adjustments" signal is emitted when one or both
adjustments (specified by hadjustment
and
vadjustment
) are set on
textview
.
def callback(textview
, user_param1
, ...
)
| the textview that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "toggle-overwrite" signal is emitted when the user presses the Insert key.