This is an excellent point you are making! Such a mechanism will enable an additional kind
of interaction (e.g., semantic zooming). This was on my todo list of long. Your email
pushed this todo at the top of my todo stack.
I have updated Roassal with such a callback. Here is an example:
| callback t |
callback := TRCameraScaleCallback new.
t := 0.
callback block: [ :newScale | t := t + 1 ].
camera addCallback: callback.
self assert: t equals: 0.
camera scale: 0.5.
self assert: t equals: 1.
camera scale: 10.
self assert: t equals: 2.
camera scale: 11.
self assert: t equals: 3.
Things to keep in mind:
- you need to register the callback in the camera
- if your callback changes something on the view, you may need to use #signalUpdate
(although I haven’t tried).
Alexandre Bergel http://www.bergel.eu
On Nov 6, 2014, at 7:22 PM, Jan B. <bliznjan(a)fit.cvut.cz>
In our Roassal 2 based app, we would like to have current zoom displayed. We
need to change the value when camera scale changes. Maybe I could make
events for all possible sources of zooming, but it seems pretty error-prone
and I did not find a way to do it for RTZoomableView source.
Therefore, I think we need something like "TRCameraScaleCallback", or any
idea how to do it other way.
View this message in context:
Sent from the Moose mailing list archive at Nabble.com
Moose-dev mailing list