Top | ![]() |
![]() |
![]() |
![]() |
gboolean | enable-language-menu | Read / Write |
gboolean | inline-spell-checking | Read / Write |
GtkTextView * | view | Read / Write / Construct Only |
GspellTextView extends the GtkTextView class with inline spell checking.
Misspelled words are highlighted with a PANGO_UNDERLINE_ERROR
, usually a red
wavy underline. Right-clicking a misspelled word pops up a context menu of
suggested replacements. The context menu also contains an “Ignore All” item
to add the misspelled word to the session dictionary. And an “Add” item to
add the word to the personal dictionary.
The spell is checked only on the visible region of the GtkTextView. Note that if a same GtkTextBuffer is used for several views, the misspelled words are visible in all views, because the highlighting is achieved with a GtkTextTag added to the buffer.
You need to call gspell_text_buffer_set_spell_checker()
to associate a
GspellChecker to the GtkTextBuffer. GspellTextView handles automatically
changes to the following properties: “buffer”,
“spell-checker” and “language”.
Note that GspellTextView extends the GtkTextView class but without subclassing it, because the GtkSourceView library has already a GtkTextView subclass.
GspellTextView *
gspell_text_view_get_from_gtk_text_view
(GtkTextView *gtk_view
);
Returns the GspellTextView of gtk_view
. The returned object is guaranteed
to be the same for the lifetime of gtk_view
.
gboolean
gspell_text_view_get_inline_spell_checking
(GspellTextView *gspell_view
);
void gspell_text_view_set_inline_spell_checking (GspellTextView *gspell_view
,gboolean enable
);
Enables or disables the inline spell checking.
gboolean
gspell_text_view_get_enable_language_menu
(GspellTextView *gspell_view
);
Since: 1.2
void gspell_text_view_set_enable_language_menu (GspellTextView *gspell_view
,gboolean enable_language_menu
);
Sets whether to enable the language context menu. If enabled, doing a right click on the GtkTextView will show a sub-menu to choose the language for the spell checking. If another language is chosen, it changes the “language” property of the “spell-checker” of the “buffer” of the “view”.
Since: 1.2
“enable-language-menu”
property“enable-language-menu” gboolean
When the context menu is shown, whether to add a sub-menu to select the language for the spell checking.
Flags: Read / Write
Default value: FALSE
Since: 1.2
“inline-spell-checking”
property“inline-spell-checking” gboolean
Whether the inline spell checking is enabled.
Flags: Read / Write
Default value: FALSE