Chris Mitchell wrote:
> I wish to use floatcanvas
First, is this FloatCanvas 1 or 2?
I'll answer for FC 1:
> to display a visualization of amino acids and
> various domains under various structural variations. In short, what I
> intend is to make a string like 'APVL'....with multicolored blocks
> representing domains and such.
so you are displaying letters, with different colored backgrounds?
> What I need help with is on the
> alignment so I can place multicolored strings next to eachother and
> overlay blocks on certain positions. Is there a way to fetch the
> coordinates from a statictextbox object?
do you mean ScaledText object?
SC.BoundingBox should do it, however, from the notes in the code:
"""
def CalcBoundingBox(self):
## this isn't exact, as fonts don't scale exactly.
"""
I guess I looked into that a bit at the time. Also, aside from scaling
issues, wx.DC is a bit weak with text extents -- it gives you a box
around the text, but it won't necessarily line up the "base line" right
if you put multiple chunks of text next to each-other.
> XY variable, or BoxWidth, or CalcBoundingBox, without any luck. One way
> it seems would to set the TextWidth variable inside floatcanvas to
> something I can retrieve remotely.
.BoundingBox should have it, it just may not line up all that well.
So:
A) post some small sample code, and maybe I can see what's wrong.
B) if it really doesn't work well, you should be able to create your own
drawobject that has a clearly defined bounding box -- maybe every letter
would be a rectangle you draw, each one the same size, with the letter
drawn on top.
You could either start "from scratch" by looking at the Rectangle and
Text classes, or use a Group object, and put a Scaled Text object on top
of a rectangle.
HTH,
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[email protected]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas