Trait gspell::prelude::TextViewExt
source · pub trait TextViewExt: IsA<TextView> + Sealed + 'static {
// Provided methods
fn basic_setup(&self) { ... }
fn enables_language_menu(&self) -> bool { ... }
fn is_inline_spell_checking(&self) -> bool { ... }
fn view(&self) -> Option<TextView> { ... }
fn set_enable_language_menu(&self, enable_language_menu: bool) { ... }
fn set_inline_spell_checking(&self, enable: bool) { ... }
fn connect_enable_language_menu_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_inline_spell_checking_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn basic_setup(&self)
fn basic_setup(&self)
This function is a convenience function that does the following:
- Set a spell checker. The language chosen is the one returned by
Language::default()
. - Set the
inline-spell-checking
property totrue
. - Set the
enable-language-menu
property totrue
.
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);
Returns
whether the language context menu is enabled.
sourcefn is_inline_spell_checking(&self) -> bool
fn is_inline_spell_checking(&self) -> bool
Returns
whether the inline spell checking is enabled.
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
language
property of the spell-checker
of
the buffer
of the view
.
enable_language_menu
whether to enable the language context menu.
sourcefn set_inline_spell_checking(&self, enable: bool)
fn set_inline_spell_checking(&self, enable: bool)
fn connect_inline_spell_checking_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId
Object Safety§
This trait is not object safe.