Thanks Alexandre. You probably already know what I present here, but I got curious about how the recursion was occurring (another chance to learn more digging into the system) and I learn better if I have to get it down in writing. I also have a fix if the overhead was acceptable.
I have the impression that your fix is rather complicated.
Without trying to understand why it is so important to have a label that tells the size of itself, you could simply have:
-=--=-=--=-=--=-=--=-=--=
"Preambule. It includes the initialization. "
| rawView view node innerNode |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"enter your script below"
"-------------"
"-------------"
node := view node: 'foo'.
innerNode := ROElement new + (ROLabel text: [ :v | node bounds]).
innerNode @ RODraggable.
node on: ROMouseDragging do: [ :ann | ROAdjustSizeOfNesting on: node ].
node add: innerNode.
ROAdjustSizeOfNesting on: node.
"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open
-=--=-=--=-=--=-=--=-=--=
A label inside tells the size of its owner. Thus breaking the egg-chicken recursion.
The attachment shows recursion starting at ROLabel>>extentFor:. You can see the rough fix I implemented. (Note the snapshot is from after I implemented the fix, so for this snapshot I cheated and manually forced (blockRecurion:=nil) in the debugger for one step.) btw, to find the right place to debug for the recursion without locking up the system, I used the following Workspace code. The whole thing needs to be executed in one go so that the context of the 'xx' variable is the same throughout.
Using thread in that way is dangerous :-)