Skip to main content

libadwaita/
functions.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3/// Initializes Libadwaita.
4///
5/// This function can be used instead of `init()` as it initializes GTK
6/// implicitly.
7///
8/// There's no need to call this function if you're using [`Application`][crate::Application].
9///
10/// If Libadwaita has already been initialized, the function will simply return.
11///
12/// This makes sure translations, types, themes, and icons for the Adwaita
13/// library are set up properly.
14#[doc(alias = "adw_init")]
15pub fn init() -> Result<(), glib::BoolError> {
16    skip_assert_initialized!();
17    gtk::init()?;
18    unsafe {
19        ffi::adw_init();
20    }
21    Ok(())
22}