[]Struct gtk::EntryCompletion

pub struct EntryCompletion(_, _);

EntryCompletion is an auxiliary object to be used in conjunction with Entry to provide the completion functionality. It implements the CellLayout interface, to allow the user to add extra cells to the TreeView with completion matches.

“Completion functionality” means that when the user modifies the text in the entry, EntryCompletion checks which rows in the model match the current content of the entry, and displays a list of matches. By default, the matching is done by comparing the entry text case-insensitively against the text column of the model (see EntryCompletionExt::set_text_column), but this can be overridden with a custom match function (see EntryCompletionExt::set_match_func).

When the user selects a completion, the content of the entry is updated. By default, the content of the entry is replaced by the text column of the model, but this can be overridden by connecting to the EntryCompletion::match-selected signal and updating the entry in the signal handler. Note that you should return true from the signal handler to suppress the default behaviour.

To add completion functionality to an entry, use EntryExt::set_completion.

In addition to regular completion matches, which will be inserted into the entry when they are selected, EntryCompletion also allows to display “actions” in the popup window. Their appearance is similar to menuitems, to differentiate them clearly from completion strings. When an action is selected, the EntryCompletion::action-activated signal is emitted.

EntryCompletion uses a TreeModelFilter model to represent the subset of the entire model that is currently matching. While the EntryCompletion signals EntryCompletion::match-selected and EntryCompletion::cursor-on-match take the original model and an iter pointing to that model as arguments, other callbacks and signals (such as GtkCellLayoutDataFuncs or CellArea::apply-attributes) will generally take the filter model as argument. As long as you are only calling TreeModel::get, this will make no difference to you. If for some reason, you need the original model, use TreeModelFilterExt::get_model. Don’t forget to use TreeModelFilterExt::convert_iter_to_child_iter to obtain a matching iter.

Implements

EntryCompletionExt, glib::object::ObjectExt, BuildableExt, CellLayoutExt, EntryCompletionExtManual, BuildableExtManual

Implementations

impl EntryCompletion[src]

pub fn new() -> EntryCompletion[src]

Creates a new EntryCompletion object.

Returns

A newly created EntryCompletion object

pub fn with_area<P: IsA<CellArea>>(area: &P) -> EntryCompletion[src]

Trait Implementations

impl Clone for EntryCompletion

impl Debug for EntryCompletion

impl Default for EntryCompletion[src]

impl Display for EntryCompletion[src]

impl Eq for EntryCompletion

impl Hash for EntryCompletion

impl IsA<Buildable> for EntryCompletion

impl IsA<CellLayout> for EntryCompletion

impl Ord for EntryCompletion

impl<T: ObjectType> PartialEq<T> for EntryCompletion

impl<T: ObjectType> PartialOrd<T> for EntryCompletion

impl StaticType for EntryCompletion

Auto Trait Implementations

impl RefUnwindSafe for EntryCompletion

impl !Send for EntryCompletion

impl !Sync for EntryCompletion

impl Unpin for EntryCompletion

impl UnwindSafe for EntryCompletion

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.