Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to rotate a complex object on the canvas

46 views
Skip to first unread message

maura.m...@gmail.com

unread,
Dec 29, 2006, 5:06:44 AM12/29/06
to
In order to better explain my goal I have uploaded the following image
to my web site:

http://www.trusoftdev.za.net/maura/MARS-gui/ColorBar-Rotation.png

With reference to the picture above, my goal is to rotate by 90 degrees
and move the color-bar, that nowappears at the bottom of the canvas,
in order to free space for inserting texts.
Of coutse also the numerical labels underneath and at its isded , the
small axes symbol and the "Aspect Ratio .." must be rotated and move
with the color_bar appropriately.

Is the above feasible through any magic Tcl/Tk command ?

Thank you in advance,
Maura

suchenwi

unread,
Dec 29, 2006, 7:12:44 AM12/29/06
to

maura.m...@gmail.com schrieb:

> http://www.trusoftdev.za.net/maura/MARS-gui/ColorBar-Rotation.png
>
> With reference to the picture above, my goal is to rotate by 90 degrees
> and move the color-bar, that nowappears at the bottom of the canvas,
> in order to free space for inserting texts.
> Of coutse also the numerical labels underneath and at its isded , the
> small axes symbol and the "Aspect Ratio .." must be rotated and move
> with the color_bar appropriately.
>
> Is the above feasible through any magic Tcl/Tk command ?

Rotation by any degree is only possible for line and polygon items.
A kind of rotation in 90 degree steps is also possible for rectangles
and ovals.
Your screenshot shows many items composed in various ways - I'm afraid
you'll have to rewrite the code that creates them all, especially as
you also want to move parts to some other place.

maura.m...@gmail.com

unread,
Dec 29, 2006, 3:46:09 PM12/29/06
to
I understand that "rotate" that complex object is tantamount to
deleting it and recreating it in the new position. After I'll have
integrated Blt that allows for rotating texts it'll become feasible ..
I guess
Thank you,
Maura

Donal K. Fellows

unread,
Dec 29, 2006, 3:56:52 PM12/29/06
to
maura.m...@gmail.com wrote:
> Is [rotating canvas items] feasible through any magic Tcl/Tk command ?

No, and even if you're rotating things piecemeal, the particular problem
right now is rotating the text. That's supposed to change by the time
8.5 goes Final, but it's not yet implemented. You should be able to make
a rotated version of the other parts of the key just nicely though; if
you pick your font sizes carefully, it will work "well enough" anyway.

Anyway, to details.

Line and polygon items are trivial to rotate using standard affine
transforms. Rectangle and oval items can be rotated the same way, but
only come out looking right if rotated by 90 degree increments. Anything
that's an image will have to be rotated manually (I think there's some
code that's efficient for 90 degree rotations on the Wiki) anyway;
canvases just see those as an opaque rectangle, rather like an embedded
widget. Text items are really the same, but as mentioned above it should
be possible to fake them in 8.5.

Donal.

0 new messages