Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem in SWT Text widget and Mac
Problem in SWT Text widget and Mac [message #506630] Fri, 08 January 2010 12:41 Go to next message
Romain Bioteau is currently offline Romain BioteauFriend
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 #507024 is a reply to message #506630] Mon, 11 January 2010 12:12 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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
Re: Problem in SWT Text widget and Mac [message #507156 is a reply to message #507024] Tue, 12 January 2010 05:46 Go to previous message
Romain Bioteau is currently offline Romain BioteauFriend
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
Previous Topic:Re: OpenSolaris: Eclipse/SWT hangs in GTK OS call when trying to change fonts
Next Topic:Losing SyncExec events?
Goto Forum:
  


Current Time: Wed Dec 04 16:41:05 GMT 2024

Powered by FUDForum. Page generated in 0.03334 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top