Created
September 20, 2017 15:43
-
-
Save federicomenaquintero/4f55c251d50787bee2d60b5e26e5fc93 to your computer and use it in GitHub Desktop.
gobject_gen!() syntax example
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
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