-
Hi, I have a simple question, How can I add a new tab to a tree. I have this struct pub struct AcquisitionsDock{
pub tree: DockState<AcquisitionDock>,
}
impl Default for AcquisitionsDock {
fn default() -> Self {
Self {
tree: DockState::new(vec![AcquisitionDock::new(uuid::Uuid::new_v4(), "Hardcoded")])
}
}
}
impl AcquisitionsDock{
pub fn add(&mut self, id: uuid::Uuid, title: String) {
debug!("Adding {:?} {:?}", id, title);
self.tree.push_to_focused_leaf(AcquisitionDock::new(id, title.as_str()));
// self.tree.main_surface_mut().push_to_focused_leaf(AcquisitionDock::new(id, title.as_str()));
}
} I can see the "Hardcoded" tab on launch, and i can see the debug statement when I click a button, but the push_to_focused_leaf does not add the acquisition to the doc. any ideas? |
Beta Was this translation helpful? Give feedback.
Answered by
wlwatkins
Feb 26, 2024
Replies: 1 comment
-
Nevermind, had two instances of AcquisitionDock running. this works :) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wlwatkins
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, had two instances of AcquisitionDock running. this works :)