Skip to main content

gtk4/
entry.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::{Entry, prelude::*};
6
7// rustdoc-stripper-ignore-next
8/// Trait containing manually implemented methods of [`Entry`](crate::Entry).
9pub trait EntryExtManual: IsA<Entry> + 'static {
10    /// .
11    ///
12    /// # Returns
13    ///
14    /// the current invisible char, or 0, if the entry does not
15    ///   show invisible text at all.
16    #[doc(alias = "gtk_entry_get_invisible_char")]
17    #[doc(alias = "get_invisible_char")]
18    fn invisible_char(&self) -> Option<char> {
19        let ret =
20            unsafe { crate::ffi::gtk_entry_get_invisible_char(self.as_ref().to_glib_none().0) };
21        if ret == 0 {
22            return None;
23        }
24        Some(TryFrom::try_from(ret).expect("conversion from an invalid Unicode value attempted"))
25    }
26}
27
28impl<O: IsA<Entry>> EntryExtManual for O {}