'From Pharo1.4 of 18 April 2012 [Latest update: #14457] on 16 September 2012 at
8:20:35 pm'!
!ROTranslatingShape methodsFor: 'accessing' stamp: 'BenComan 9/16/2012
20:20'!
usecase6
"
self new usecase6
"
"
Place the ROLabel central to the element.
However I can't work out how to get the label both centered as well as drawn in front
of the circle.
In the first try, the text is centered on but behind the circle.
In the second second try, the text is in front but not centered on the circle.
Properly the offset should be something like (circle center - circleLabel center), but
not sure how to do the latter
Also center-justified text would be good at some point.
"
| view circle circleLabel |
view := ROView new.
circle := (ROElement on:
'this is
near the
center').
circleLabel := ROLabel new text: [ :el | el model asString].
circle extent: 200 @ 200.
circle @ RODraggable.
circle + ROBorder + (ROCircle new color: (Color lightGreen alpha: 0.8) )+
(ROTranslatingShape new offset: (circle center) ) + circleLabel . "first try"
"circle + ROBorder + (ROTranslatingShape new offset: (circle center) ) + circleLayout
+ (ROCircle new color: (Color lightGreen alpha: 0.8) ) . " "second try"
"circleLabel inspect." "btw, if you comment this line, you will see that
the extent of the circleLayout has not been updated from default 5@5"
view add: circle .
view open.! !