gtk4/
entry_completion.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{prelude::*, Entry, EntryCompletion, Widget};
6
7impl EntryCompletion {
8    #[doc(alias = "gtk_entry_completion_get_entry")]
9    #[doc(alias = "get_entry")]
10    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
11    #[allow(deprecated)]
12    pub fn entry(&self) -> Option<Entry> {
13        unsafe {
14            Option::<Widget>::from_glib_none(crate::ffi::gtk_entry_completion_get_entry(
15                self.to_glib_none().0,
16            ))
17            .map(|widget| {
18                widget
19                    .downcast()
20                    .expect("Non-Entry widget received from get_entry method")
21            })
22        }
23    }
24}