[go: up one dir, main page]

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