gtkspell.Spell
Prev | The GtkSpell Class Reference |

## gtkspell.Spell

gtkspell.Spell — Spell object for gtk.TextView

## Synopsis

    class gtkspell.Spell():
        gtkspell.Spell(text, language=None)
        def set_language(lang)
        def recheck_all()
        def detach()

    Functions

        def gtkspell.get_from_text_view(view)

## Ancestry

    +-- gtkspell

## Description

The `gtkspell.Spell` used in concert with `gtk.TextView` provides mis-spelled word highlighting in red and offers a right click pop-up menu with suggested corrections.

## Constructor

        gtkspell.Spell(text, lang=None)

`text` : | a `gtk.TextView`
`lang` : | the language to use, in a form like "en_US" or `None`
Returns : | a new `gtkspell.Spell`.

Creates a new `gtkspell.Spell` object.

### Note

If `lang` is `None` then $LANG will be used, if also $LANG is `None` or not valid then English will be used as default.

## Methods

### gtkspell.Spell.set_language

        def set_language(lang)

`lang` : | the language to use in the form "en_US".

The `set_language`() method set the language that have to be used while checking for mispelled words.

### gtkspell.Spell.recheck_all

        def recheck_all()

The `recheck_all`() method recheck the spelling in the entire buffer.

### gtkspell.Spell.detach

        def detach()

The `detach`() method detaches this `gtkspell.Spell` from its `gtk.TextView`, use the function `gtkspell.get_from_text_view` to retrieve a `gtkspell.Spell` from a `gtk.TextView`.

## Functions

### gtkspell.get_from_text_view

        def gtkspell.get_from_text_view(view)

`view` : | a `gtk.TextView`.
Returns : | the `gtkspell.Spell` object or `None` if there is no `gtkspell.Spell` attached to `view`.

Retrieves the `gtkspell.Spell` object attached to a text view.

Prev | Up |
The GtkSpell Class Reference | Home |