Re: Text Widget Confession [message #26766 is a reply to message #26626] |
Fri, 21 September 2001 11:34   |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
David Fanning wrote:
>
> 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.)
for linux please try
['Dog'+string(10b)+'Cow'+string(10b)+'Coyote'+string(10b)]
and ysize=1
this gives the same result as Davids list and ysize=3.
But I was not able to reproduce this on windows.
Reimar
>
>> 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
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======
read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
|
|
|