| Re: Text Widget Confession [message #26769 is a reply to message #26626] |
Fri, 21 September 2001 11:03   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Don J Lindler (lindler@rockit.gsfc.nasa.gov) writes:
> I think you are confused because you chose an unfornunate example.
> ['Dog','Cow','Coyote']
Well, I have to think simply or *nothing* works. :-)
> The length of the lines are 5, 5, and 8 which add to 18. I assume it is the
> characters in the line plus a line feed and <cr>. So that Line 0 starts at
> offset 0, line 1 starts at offset 5 and line 3 starts at offset 10.
Of course, I immediately assumed that each line had
a carriage return and a line feed. But the odd thing
is that I can't recover them. Where are they? Converting
the text to a byte array results in zeros, but no 10s or 13s.
(Not to mention there are not enough 0s either.)
> Since the Text_Offset_to_XY keyword in Widget_Info does not seem to work
> right, you will have to compute the offsets to each line manually by
> accummulating the string lengths plus 2 for all previous lines.
Well, yes, but surely this is not what RSI had in mind
here, is it? I mean, this isn't object graphics, right?
> Wouldn't a list widget work better for what you are doing?
Of course, and that is exactly how I solved the problem.
But it didn't really clear up any of my questions. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|