Gspell.TextView

g GObject.Object GObject.Object Gspell.TextView Gspell.TextView GObject.Object->Gspell.TextView

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_from_gtk_text_view (gtk_view)

basic_setup ()

get_enable_language_menu ()

get_inline_spell_checking ()

get_view ()

set_enable_language_menu (enable_language_menu)

set_inline_spell_checking (enable)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

enable-language-menu

bool

r/w

inline-spell-checking

bool

r/w

view

Gtk.TextView

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Gspell.TextView(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gspell.TextViewClass

classmethod get_from_gtk_text_view(gtk_view)
Parameters:

gtk_view (Gtk.TextView) – a Gtk.TextView.

Returns:

the Gspell.TextView of gtk_view.

Return type:

Gspell.TextView

Returns the Gspell.TextView of gtk_view. The returned object is guaranteed to be the same for the lifetime of gtk_view.

basic_setup()

This function is a convenience function that does the following:

Example:

GtkTextView *gtk_view;
GspellTextView *gspell_view;

gspell_view = gspell_text_view_get_from_gtk_text_view (gtk_view);
gspell_text_view_basic_setup (gspell_view);

This is equivalent to:

GtkTextView *gtk_view;
GspellTextView *gspell_view;
GspellChecker *checker;
GtkTextBuffer *gtk_buffer;
GspellTextBuffer *gspell_buffer;

checker = gspell_checker_new (NULL);
gtk_buffer = gtk_text_view_get_buffer (gtk_view);
gspell_buffer = gspell_text_buffer_get_from_gtk_text_buffer (gtk_buffer);
gspell_text_buffer_set_spell_checker (gspell_buffer, checker);
g_object_unref (checker);

gspell_view = gspell_text_view_get_from_gtk_text_view (gtk_view);
gspell_text_view_set_inline_spell_checking (gspell_view, TRUE);
gspell_text_view_set_enable_language_menu (gspell_view, TRUE);

New in version 1.2.

get_enable_language_menu()
Returns:

whether the language context menu is enabled.

Return type:

bool

New in version 1.2.

get_inline_spell_checking()
Returns:

whether the inline spell checking is enabled.

Return type:

bool

get_view()
Returns:

the Gtk.TextView of self.

Return type:

Gtk.TextView

set_enable_language_menu(enable_language_menu)
Parameters:

enable_language_menu (bool) – whether to enable the language context menu.

Sets whether to enable the language context menu. If enabled, doing a right click on the Gtk.TextView will show a sub-menu to choose the language for the spell checking. If another language is chosen, it changes the Gspell.Checker :language property of the Gspell.TextBuffer :spell-checker of the Gtk.TextView :buffer of the Gspell.TextView :view.

New in version 1.2.

set_inline_spell_checking(enable)
Parameters:

enable (bool) – the new state.

Enables or disables the inline spell checking.

Property Details

Gspell.TextView.props.enable_language_menu
Name:

enable-language-menu

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

When the context menu is shown, whether to add a sub-menu to select the language for the spell checking.

New in version 1.2.

Gspell.TextView.props.inline_spell_checking
Name:

inline-spell-checking

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the inline spell checking is enabled.

Gspell.TextView.props.view
Name:

view

Type:

Gtk.TextView

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gtk.TextView.