gtkspell  3-3.0.10
About: GtkSpell provides word-processor-style highlighting and replacement of misspelled words in a GtkTextView widget.
  Fossies Dox: gtkspell3-3.0.10.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

No Matches
gtkspell Documentation

Some Fossies usage hints in advance:

  1. To see the Doxygen generated documentation please click on one of the items in the steelblue colored "quick index" bar above or use the side panel at the left which displays a hierarchical tree-like index structure and is adjustable in width.
  2. If you want to search for something by keyword rather than browse for it you can use the client side search facility (using Javascript and DHTML) that provides live searching, i.e. the search results are presented and adapted as you type in the Search input field at the top right.
  3. Doxygen doesn't incorporate all member files but just a definable subset (basically the main project source code files that are written in a supported language). So to search and browse all member files you may visit the Fossies gtkspell3-3.0.10.tar.xz contents page and use the Fossies standard member browsing features (also with source code highlighting and additionally with optional code folding).

/* gtkspell - a spell-checking addon for GTK's TextView widget

  • Copyright (c) 2002 Evan Martin
  • Copyright (c) 2012-2013 Sandro Mani */


GtkSpell is a library which provides MSWord/MacOSX-style highlighting of misspelled words in a GtkTextView widget. Right-clicking a misspelled word pops up a menu of suggested replacements.

GtkSpell depends on

  • GTK+3
  • Enchant
  • GObject Introspection
  • GTK-Doc (optional)
  • GTK+2 (optional)

For more information, see .

Use of the C API

The easiest way to learn is to look at the provided example programs. It's pretty simple.

Use gtk_spell_checker_new() and gtk_spell_checker_attach() to attach a new GtkSpellChecker to a GtkTextView.

For convenience, gtk_spell_checker_new() is created as GInitiallyUnowned and gtk_spell_checker_attach() will sink the floating reference. gtk_spell_checker_attach() also connects the 'destroy' signal of the passed-in GObject to g_object_unref() the GtkSpellChecker, so in the most common use-case, you need not worry about cleaning it up, see examples/simple.c.

However, if you want to detach and later reattach the GtkSpellChecker to a (possibly different) GtkTextView, you must get a pointer to it with gtk_spell_checker_get_from_text_view(), call g_object_ref() on the resulting pointer, call gtk_spell_checker_detach() on it, call gtk_spell_checker_attach() with the new GtkTextView, and finally call g_object_unref() to release the reference that you took at the beginning.

Alternatively, you can sink the GtkSpellChecker immediately upon construction with g_object_ref_sink(), in which case you will retain the ownership of the GtkSpellChecker throughout the lifetime of the program, and you must remember to call g_object_unref() when you don't need it any more, see examples/advanced.c.

You don't need to keep a pointer to an attached GtkSpellChecker object around, but you can retrieve it from a GtkTextView with gtk_spell_checker_get_from_text_view() when necessary.

Once you have a pointer to a GtkSpellChecker, you can change the language it uses with gtk_spell_checker_set_language(). Use gtk_spell_checker_detach() to remove the GtkSpellChecker from its attached GtkTextView. Note that the GtkSpellChecker will get destroyed when gtk_spell_checker_detach() is called unless a reference is taken before via g_object_ref(). Finally, gtk_spell_checker_recheck_all() is provided to re-spellcheck the entire buffer, but it shouldn't be necessary.

An API reference can be found in the documentation. It the documentation was not installed, gtkspell.h serves as an API reference.

Available bindings

The package also includes python-bindings via GObject typelibs as well as vala bindings, if they were compiled.

Original Author

Evan Martin -

Previous Maintainers

Nathan Fredrickson Eduardo PĂ©rez Ureta -

Current Maintainers

Sandro Mani Daniel Atallah


Ari Pollak - Debian packages. Alex - Redhat packages. Evan Nemerson - Vala bindings.

vim: tw=72