Skip to content

Instantly share code, notes, and snippets.

@federicomenaquintero
Created September 20, 2017 15:43
Show Gist options
  • Save federicomenaquintero/4f55c251d50787bee2d60b5e26e5fc93 to your computer and use it in GitHub Desktop.
Save federicomenaquintero/4f55c251d50787bee2d60b5e26e5fc93 to your computer and use it in GitHub Desktop.
gobject_gen!() syntax example
gobject_gen! {
class Dummy {
struct DummyPrivate {
foo: RefCell<MyStruct>
}
private_init() -> DummyPrivate {
DummyPrivate {
foo: RefCell::new(MyStruct::new())
}
}
signal value_changed(&self);
fn set_foo(&self, foo: MyStruct) {
let mut self_foo = self.get_priv().dc.borrow_mut();
*self_foo = foo;
}
virtual fn blah(&self, arg: i32) {
// some code here
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment