mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Initialize the component in the Window at component creation time
This will allow getting rid of the component as parameter to run()
This commit is contained in:
parent
a09355c634
commit
64b92df87e
6 changed files with 34 additions and 4 deletions
|
@ -114,6 +114,14 @@ public:
|
|||
vtable::VRef<ComponentVTable> { &Component::component_type, c }, items, &inner);
|
||||
}
|
||||
|
||||
template<typename Component>
|
||||
void set_component(const Component &c) const
|
||||
{
|
||||
auto self_rc = c.self_weak.lock().value();
|
||||
sixtyfps_component_window_set_component(
|
||||
&inner, reinterpret_cast<cbindgen_private::ComponentRc *>(&self_rc));
|
||||
}
|
||||
|
||||
private:
|
||||
cbindgen_private::ComponentWindowOpaque inner;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue