gtksourceview2.View — a widget that displays the source code
class gtksourceview2.View(gtk.TextView): |
+-- gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.TextView +-- gtksourceview2.View
|
|
"redo" | def callback( |
"undo" | def callback( |
A gtksourceview2.View
is a text widget that extends the standard gtk.TextView
It improves the gtk.TextView
by implementing syntax highlighting
and other features typical of a source editor.
gtksourceview2.View(buffer
=None)
| a gtksourceview2.Buffer
or None |
Returns: | a new gtksourceview2.View .
|
Creates a new gtksourceview2.View
widget displaying the
gtksourceview2.Buffer
specified by
buffer
. If buffer
is None
, a new
gtksourceview2.Buffer
will be created.
One sourcebuffer can be shared among many widgets.
def get_auto_indent()
Returns: | True if auto indentation is enabled,
False otherwise. |
The get_auto_indent
() method returns whether
auto indentation of text is enabled.
def get_draw_spaces()
Returns: | One of gtksourceview2.DRAW_SPACES_SPACE, gtksourceview2.DRAW_SPACES_TAB gtksourceview2.DRAW_SPACES_NEWLINE or gtksourceview2.DRAW_SPACES_ALL. |
The get_draw_spaces
() method returns one of the flags
specifying if and how spaces should be displayed for this view.
def get_highlight_current_line()
Returns: | True if the current line is highlighted,
False otherwise. |
The get_highlight_current_line
() method returns
whether the current line is highlighted.
def get_indent_on_tab()
Returns: | True if the selection is indented when tab is pressed.
False otherwise. |
The get_indent_on_tab
() method returns
whether when the tab key is pressed the current selection should get
indented instead of replaced with the \t character.
def get_indent_width()
Returns: | the indent width. |
The get_indent_width
() method returns
the number of spaces to use for each step of indent.
See gtksourceview2.View.set_indent_width
()
for details.
def get_insert_spaces_instead_of_tabs()
Returns: | True if spaces are inserted instead of tabs.
False otherwise. |
The get_insert_spaces_instead_of_tabs
() method returns
whether when inserting a tabulator character it should be replaced by a
group of space characters.
def get_mark_category_background(category
)
| a marker category. |
Returns: | a gtk.gdk.Color
if found, or None if not found. |
The get_marker_category_pixbuf
() method gets the pixbuf which
is associated with the given category.
def get_mark_category_pixbuf(category
)
| a marker category. |
Returns: | a gtk.gdk.Pixbuf
if found, or None if not found. |
The get_marker_category_pixbuf
() method gets the pixbuf which
is associated with the given category.
def get_mark_category_priority(category
)
| a marker category. |
Returns: | a gtk.gdk.Pixbuf
if found, or None if not found. |
The get_mark_category_priority
() method gets
the priority which is associated with the given category.
def get_right_margin_position()
Returns: | the position of the right margin. |
The get_right_margin_position
() method
gets the position of the right margin.
def get_show_line_marks()
Returns: | True if the line marks are displayed.
False otherwise. |
The get_show_line_marks
() method returns
whether line marks are displayed beside the text.
def get_show_line_numbers()
Returns: | True if the line numbers are displayed.
False otherwise. |
The get_show_line_numbers
() method returns
whether line numbers are displayed beside the text.
def get_show_right_margin()
Returns: | True if the right margin is displayed.
False otherwise. |
The get_show_right_margin
() method returns
whether a right margin is displayed.
def get_smart_home_end()
Returns: | a GtkSourceSmartHomeEndType value specifying how the cursor will move when HOME and END keys are pressed. |
The get_smart_home_end
() method returns
a value specifying how the cursor will move when HOME
and END keys are pressed.
def get_tab_width()
Returns: | the width of tab. |
The get_tab_width
() method returns
the width of tabulation in characters.
def set_auto_indent(enabled
)
| if True auto indentation of text is enabled. |
The set_auto_indent
() method sets whether to enable auto indentation.
def set_draw_spaces(flags
)
| one of gtksourceview2.DRAW_SPACES_SPACE, gtksourceview2.DRAW_SPACES_TAB gtksourceview2.DRAW_SPACES_NEWLINE or gtksourceview2.DRAW_SPACES_ALL, specifing how white spaces should be displayed. |
The set_draw_spaces
() method set if and how the
spaces should be visualized. Specifying flags as 0 will disable display of spaces.
def set_highlight_current_line(show
)
| if True the current line is highlighted. |
The set_highlight_current_line
() method sets
whether to highlight the current line.
def set_indent_on_tab(enabled
)
| if True indent a block when tab is pressed. |
The set_indent_on_tab
() method sets
when the tab key is pressed and there is a selection, the selected
text is indented of one level instead of being replaced with the \t
characters. Shift+Tab unindents the selection.
def set_indent_width(width
)
| indent width in characters. |
The set_indent_width
() method sets
the number of spaces to use for each step of indent. If width is -1,
the value of the GtkSourceView::tab-width property will be used.
def set_insert_spaces_instead_of_tabs(enabled
)
| if True insert spaces instead of tabs. |
The set_insert_spaces_instead_of_tabs
() method sets
whether any tabulator character inserted is replaced by a group of space characters.
def set_mark_category_background(category
, color
)
| a marker category. |
| a gtk.gdk.Color
or None . |
The set_mark_category_priority
() method
sets given background color for mark category.
If color is None
, the background color is unset.
def set_mark_category_pixbuf(category
, pixbuf
)
| a marker category. |
| a gtk.gdk.Pixbuf
or None . |
The set_mark_category_priority
() method
associates a given pixbuf
with a given
category
. If pixbuf is None
,
the pixbuf is unset.
def set_mark_category_priority(category
, priority
)
| a marker category. |
| the priority for the category. |
The set_mark_category_priority
() method
Set the priority for the given mark category. When there are multiple marks
on the same line, marks of categories with higher priorities will be drawn on top.
def set_right_margin_position(pos
)
| The width in characters where to position the right margin. |
The set_right_margin_position
() method sets
the position of the right margin.
def set_show_line_marks(show
)
| if True line marks will be
displayed beside the text. |
The set_show_line_marks
() method sets
whether line marks should be displayed.
def set_show_line_numbers(show
)
| if True line numbers will be
displayed beside the text. |
The set_show_line_numbers
() method sets
whether line numbers should be displayed.
def set_show_right_margin(show
)
| if True line numbers will be
displayed beside the text. |
The set_show_right_margin
() method sets
whether to show a right margin.
def callback(sourceview
, user_param1
, ...
)
| the sourceview that received the signal |
| the first user parameter (if any) specified
with the connect ()
method |
| additional user parameters (if any) |
The "redo" signal is emitted when an action has been redone.
def callback(sourceview
, user_param1
, ...
)
| the sourceview that received the signal |
| the first user parameter (if any) specified
with the connect ()
method |
| additional user parameters (if any) |
The "undo" signal is emitted when an action has been undone.