diff --git a/fitnesstrax/app/src/gtk_init.rs b/fitnesstrax/app/src/gtk_init.rs new file mode 100644 index 0000000..2ac6662 --- /dev/null +++ b/fitnesstrax/app/src/gtk_init.rs @@ -0,0 +1,10 @@ +use std::sync::Once; + +static INITIALIZED: Once = Once::new(); + +pub fn gtk_init() { + INITIALIZED.call_once(|| { + eprintln!("initializing GTK"); + let _ = gtk::init(); + }); +} diff --git a/fitnesstrax/app/src/main.rs b/fitnesstrax/app/src/main.rs index 1e86d60..316bfa6 100644 --- a/fitnesstrax/app/src/main.rs +++ b/fitnesstrax/app/src/main.rs @@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License along with Fit mod app; mod app_window; mod components; +#[cfg(test)] +mod gtk_init; mod types; mod view_models; mod views;