Top |
GspellLanguageChooser is implemented by GspellLanguageChooserButton and GspellLanguageChooserDialog.
GspellLanguageChooser is an interface that is implemented by widgets for choosing a GspellLanguage.
There are two properties: “language” and
“language-code”. They are kept in sync. The former is
useful, for example, to bind it to the GspellChecker's language property
with g_object_bind_property()
. The latter is useful to bind it to a
GSettings key with g_settings_bind()
.
When setting the language, NULL
or the empty string can be passed to pick
the default language. In that case, the “language-code”
property will contain the empty string, whereas the
“language” property will contain the actual
GspellLanguage as returned by gspell_language_get_default()
. If the user
launches the GspellLanguageChooser and chooses explicitly a language, then
the “language-code” property will no longer be empty,
even if it is the same language as the default language.
Note that if an explicit language (non-NULL
or not the empty string) is set
to the GspellLanguageChooser, then the “language-code”
property will not be empty, it will contain the language code of the passed
language, even if the language is the same as the default language.
Thus, a good default value for a GSettings key is the empty string. That way, the default language is picked, and can change depending on the locale. But once the user has chosen a language, that language is kept in the GSettings key.
const GspellLanguage *
gspell_language_chooser_get_language (GspellLanguageChooser *chooser
);
void gspell_language_chooser_set_language (GspellLanguageChooser *chooser
,const GspellLanguage *language
);
Sets the selected language.
const gchar *
gspell_language_chooser_get_language_code
(GspellLanguageChooser *chooser
);
void gspell_language_chooser_set_language_code (GspellLanguageChooser *chooser
,const gchar *language_code
);
chooser |
||
language_code |
a language code, or the empty string or |
[nullable] |
“language”
property“language” GspellLanguage *
The selected GspellLanguage.
Owner: GspellLanguageChooser
Flags: Read / Write