Alexandre Bergel wrote:
Ben,
I think I fixed the problem. 
http://code.google.com/p/moose-technology/issues/detail?id=830

However, your example will not work. The reason is that in your block provided to #text: you use #bounds. And you should not since #bounds use #text to compute its bounds. It simply loops.

Try with the following example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view el |
view := ROView new.

el := ROElement new + ROBorder red.
el @ RODraggable.
el + (ROLabel text: [ :v | v position asString ]).

view add: el.

view open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Let me know how it goes.

I will look at the Circle problem soon.

Cheers,
Alexandre


On Sep 4, 2012, at 12:41 PM, moose-technology@googlecode.com wrote:

  
Comment #3 on issue 830 by google....@ben.coman.com.au: ROLabel dynamic text not updating bounds/ROBorder properly
http://code.google.com/p/moose-technology/issues/detail?id=830

Thanks Alex.  But hold your breath and get a load of the next one. Could
be a curly one :)
That might require some deep changes - but I think it is somewhat
critical, at least
for what I was trying to achieve with ROCircleLayout,
which is to have elements to pin different corners of themselves to the
circle
depending on which quadrant they are in.

cheers -ben

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
    

  
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.

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.

| view el xx |
xx := 2.
view := ROView new.
el := ROElement new + ROBorder red.
el @ RODraggable.
el + (ROLabel text:
[ :v | 
    xx := xx + 1.
    Transcript crShow: xx asString , '  ', v position asString.
    (xx = 1) ifTrue:
    [
        xx := xx + 1.
        self halt.   "debug recursion of next line"
        v extent asString .
    ]  ifFalse:
    [
        v position asString.
    ]
]) .
view add: el.
view open.
[ (Delay forSeconds: 2) wait. xx := 0. ] fork.