Skip to content

Conceptual Clarification on Sharing Data with Tab Type and Tab Renderer #210

Discussion options

You must be logged in to vote

The boring long answer is, you can do this any way you want! However that isn't very helpful and most likely not the answer you're looking for, so ill answer more opinionated like.

As you've already mentioned you can't pass in selffor tab viewer as part of it is already being borrowed in order to create the DockArea (although i agree that would have been the best way to do it had it been possible), however what you can do is create another struct named something like SharedDatain it's own field inside MyApp, and instead give that to the tab viewer. Rust is smart enough to tell even though you're lending out two mutable references from the same underlying structure that they will never int…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JosephCatrambone
Comment options

Answer selected by JosephCatrambone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants