gloss_renderer/plugin_manager/gui/
button.rs

1use crate::scene::Scene;
2use gloss_hecs::Entity;
3use gloss_utils::abi_stable_aliases::std_types::RString;
4#[cfg(not(target_arch = "wasm32"))]
5use gloss_utils::abi_stable_aliases::StableAbi;
6
7#[repr(C)]
8#[cfg_attr(not(target_arch = "wasm32"), derive(StableAbi))]
9pub struct Button {
10    pub name: RString,
11    pub f_clicked: extern "C" fn(&RString, &Entity, &mut Scene),
12}
13
14impl Button {
15    pub fn new(name: &str, f_clicked: extern "C" fn(&RString, &Entity, &mut Scene)) -> Self {
16        Self {
17            name: RString::from(name),
18            f_clicked,
19        }
20    }
21}