Okay, I’m having a spot of bother with the TreeView. Everything is super fine, but I want to have a right-click PopupMenu on the items. I’d prefer to keep it as it is presently (not using a custom Component), but it’s impossible to have a PopupMenu created in a TreeViewItem’s itemClicked function.
- right-click an item to pop up a menu…
- right click a different item to see its menu (automatically dismissing the first one)…
- do this for a bunch of different items…
- then if you finally actually dismiss the last menu [without selecting an option OR perhaps selecting an option] then ALL the other popup-menu return checks happen (for each item you clicked) which can be a serious problem depending on what you have happen in the menu options; for example - a ‘delete’ option may trigger a treeHasChanged restructuring, then the items yet to perform their response no longer exist.
So i’m going to just go ahead and create a custom Component… it should be neater i guess… but the notes in the docs make it sound scary!
- you should not keep a reference to the component
[ how does the component know that its item is selected if i’m not able to set a bool indicator inside it when the selection is changed? ]
- the item may be deleted before the component[/b]
[ how severe is that?; it could be deleted at any time or it only matters in the destructors? ]
if i’m just going by the docs, i can’t see how it can be of any use to have a custom Component!