I have a custom widget (a Group that contains other Composites) that looks like the top image:
I want to implement the behavior that when the user double-clicks on "some text", the widget collapses to something like the bottom image.
If "some text" is double-clicked again, then the widget expands to the original version.
I could implement this by destroying/creating the other widgets inside the green rectangle (i.e., the small text, the rounded rectangle and the circle) and then calling pack() on the green rectangle upon double-click, but I was wondering if there is a more elegant coding idiom for implementing the described behavior? Note: I do not want to use a widget with a designated toggle-button (e.g., a PGroup).