GtkSpell.Checker¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Whether to show decoded language codes in the context menu (requires the iso-codes package). |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class GtkSpell.Checker(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
GtkSpell.Checkerstruct contains only private fields.- classmethod decode_language_code(lang)¶
- Parameters:
lang (
str) – The language locale specifier (i.e. “en_US”).- Returns:
The translated language specifier. Use
GLib.freeto free the returned string after use.- Return type:
Translates the language code to a human readable format (i.e. “en_US” -> “English (United States)”). Note: If the iso-codes package is not available, the unchanged code is returned.
New in version 3.0.3.
- classmethod get_from_text_view(view)¶
- Parameters:
view (
Gtk.TextView) – AGtk.TextView.- Returns:
the
GtkSpell.Checkerobject, orNoneif there is noGtkSpell.Checkerattached to view.- Return type:
Retrieves the
GtkSpell.Checkerobject attached to a text view.
- classmethod get_language_list()¶
- Returns:
a
GLib.Listof the available languages. Use g_list_free_full withGLib.freeto free the list after use.- Return type:
[
str]
Requests the list of available languages from the enchant broker.
New in version 3.0.3.
- classmethod new()¶
- Returns:
a new
GtkSpell.Checkerobject.- Return type:
Create a new
GtkSpell.Checkerobject.
- add_to_dictionary(word)¶
- Parameters:
word (
str) – The word to add to the user dictionary.
Add the specified word to the user dictionary.
New in version 3.0.9.
- attach(view)¶
- Parameters:
view (
Gtk.TextView) – TheGtk.TextViewto attach to.- Returns:
- Return type:
Attach
GtkSpell.Checkerobject to view.Note: Please read the tutorial section of the documentation to make sure you don’t leak references!
- check_word(word)¶
- Parameters:
word (
str) – The word to check.- Returns:
- Return type:
Check the specified word.
New in version 3.0.8.
- detach()¶
Detaches this
GtkSpell.Checkerfrom itsGtk.TextView. UseGtkSpell.Checker.get_from_text_view() to retrieve aGtkSpell.Checkerfrom aGtk.TextView. If theGtkSpell.Checkeris not attached to anyGtk.TextView, the function silently exits.Note: if the
GtkSpell.Checkeris owned by theGtk.TextView, you must take a reference to it to prevent it from being automatically destroyed. Please read the tutorial section of the documentation!
- get_language()¶
- Returns:
the current language. This string is owned by the spell object and must not be modified or freed.
- Return type:
Fetches the current language.
- get_suggestions(word)¶
- Parameters:
word (
str) – The word for which to fetch suggestions- Returns:
the list of spelling suggestions for the specified word, or
Noneif there are no suggestions.- Return type:
[
str]
Retreives a list of spelling suggestions for the specified word.
New in version 3.0.8.
- Parameters:
iter (
Gtk.TextIter) – Textiter of position in buffer to be corrected if necessary.- Returns:
- Return type:
Retrieves a submenu of replacement spellings, or
Noneif the word at iter is not misspelt.
- ignore_word(word)¶
- Parameters:
word (
str) – The word to add to the user ignore list.
Add the specified word to the user ignore list.
New in version 3.0.9.
- recheck_all()¶
Recheck the spelling in the entire buffer.
- set_language(lang)¶
- Parameters:
lang (
strorNone) – The language to use, as a locale specifier (i.e. “en_US”). IfNone, attempt to use the default system locale (LANG).- Raises:
- Returns:
Falseif there was an error.- Return type:
Set the language on self to lang, possibily returning an error in error.
Signal Details¶
- GtkSpell.Checker.signals.language_changed(checker, lang)¶
- Signal Name:
language-changed- Flags:
- Parameters:
checker (
GtkSpell.Checker) – The object which received the signallang (
str) – the new language which was selected.
The
::language-changedsignal is emitted when the user selects a new spelling language from the context menu.