Created
June 16, 2023 18:08
-
-
Save saivert/4cdd4189c21953b7f997475dcc65f660 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Boxed type guide | |
// Define the boxed type | |
#[derive(glib::Boxed, Clone, Default)] | |
#[boxed_type(name = "FloatVec")] | |
pub struct FloatVec(Vec<f32>); | |
impl FloatVec { | |
pub fn get(&self) -> Vec<f32> { | |
self.0.clone() | |
} | |
pub fn set(&self, value: Vec<f32>) { | |
self.0 = value; | |
} | |
} | |
// Then in your object add: | |
#[property(get, set)] | |
myfloatvec: RefCell<FloatVec>, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment