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.Checker
struct 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.free
to 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.Checker
object, orNone
if there is noGtkSpell.Checker
attached to view.- Return type:
Retrieves the
GtkSpell.Checker
object attached to a text view.
- classmethod get_language_list()¶
- Returns:
a
GLib.List
of the available languages. Use g_list_free_full withGLib.free
to 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.Checker
object.- Return type:
Create a new
GtkSpell.Checker
object.
- 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.TextView
to attach to.- Returns:
- Return type:
Attach
GtkSpell.Checker
object 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.Checker
from itsGtk.TextView
. UseGtkSpell.Checker.get_from_text_view
() to retrieve aGtkSpell.Checker
from aGtk.TextView
. If theGtkSpell.Checker
is not attached to anyGtk.TextView
, the function silently exits.Note: if the
GtkSpell.Checker
is 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
None
if 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
None
if 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 (
str
orNone
) – The language to use, as a locale specifier (i.e. “en_US”). IfNone
, attempt to use the default system locale (LANG).- Raises:
- Returns:
False
if 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-changed
signal is emitted when the user selects a new spelling language from the context menu.