Problem in SWT Text widget and Mac [message #506630] |
Fri, 08 January 2010 12:41 |
Romain Bioteau Messages: 65 Registered: August 2009 Location: Grenoble |
Member |
|
|
Hi,
I'm using the setText(String s) method on a Text widget and have
encountered a platform specific issue with mac (carbon implementation).
The issue is that I want to call setText(String s) with a string
containing "\n" characters (code : 10). Everythings seems ok, but,
when I do a getText() my "\n" has been translated in a " " (code : 32)
character.
Is it a known issue for carbon implementation ?
Is there a way to avoid this behavior ?
Thanks for the help.
Romain
R&D Engineer at BonitaSoft
|
|
|
|
Re: Problem in SWT Text widget and Mac [message #507156 is a reply to message #507024] |
Tue, 12 January 2010 05:46 |
Romain Bioteau Messages: 65 Registered: August 2009 Location: Grenoble |
Member |
|
|
Thanks Grant for the answer.
I have make the same statement as you did when I saw the javadoc.
However I solved this problem using a more drastic solution :
-> migrate to Cocoa :)
I think it's a good investment as Carbon is no more supported.
Regards,
Romain
Le 11/01/2010 17:57, Grant Gayed a écrit :
> Hi Romain,
>
> The javadoc for Text.setText() indicates that this case may not behave
> consistently. However it's probably still a bug that the same text that was
> set is not answered by the getter, so I've logged
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=299297 .
>
> The only workaround I can think of for handling the general case of this is
> to create the Text with SWT.MULTI instead. If you're expecting that it
> could contain a \n then this may be more appropriate, no?
>
> Grant
>
>
> "Romain Bioteau"<romain.bioteau@bonitasoft.com> wrote in message
> news:hi7954$jf6$1@build.eclipse.org...
>> Hi,
>> I'm using the setText(String s) method on a Text widget and have
>> encountered a platform specific issue with mac (carbon implementation).
>>
>> The issue is that I want to call setText(String s) with a string
>> containing "\n" characters (code : 10). Everythings seems ok, but,
>> when I do a getText() my "\n" has been translated in a " " (code : 32)
>> character.
>>
>> Is it a known issue for carbon implementation ?
>> Is there a way to avoid this behavior ?
>>
>> Thanks for the help.
>> Romain
>
>
R&D Engineer at BonitaSoft
|
|
|
Powered by
FUDForum. Page generated in 0.03802 seconds