| view rawView el1 el2 edge line | rawView := ROView new. el1 := ROElement new. el1 extent: 50@50. el1 + ROBox red + ROCircle yellow + ROLabel @ RODraggable. rawView add: el1. rawView open
neat isn't it?
...except that it would be nice if the ROLabel could be centred.
Yes, I will work on this.
In addition, being able to place the ROLabel in various "offset" locations,
Right, top, center, bottom? Is this what you mean?
I think that would satisfy a lot of my composition requirements - for example building a transformer compound symbol with two overlapping circles and two labels for "equipment tag" and "power size". To that effect it would be great if ROLabel or similar could have a callback mechanism to get different attributes from the model. Alternatively I guess I could make a new subclass of ROShape that draws such that directly.
I do not understand what you mean by these attributes from the model? You can do things like (using the last version):
-=-=-=-=-=-=-=-=-=-=-=-= | view rawView el1 el2 edge line | rawView := ROView new. el1 := ROElement on: 1. el1 extent: 50@50. el1 + (ROLabel new color: [ :model | model odd ifTrue: [ Color red ] ifFalse: [ Color blue ]]). el1 on: ROMouseLeftClick do: [ :ann | ann element model: (ann element model + 1). el1 shapesDo: #resetCache. rawView signalUpdate ]. el1 @ RODraggable.
rawView add: el1. rawView open -=-=-=-=-=-=-=-=-=-=-=-=
Cheers, Alexandre