Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332600 - [Mac][Combo]Combo Box Cursor Position is different in different platforms
Summary: [Mac][Combo]Combo Box Cursor Position is different in different platforms
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-15 02:52 EST by pei na CLA
Modified: 2011-01-25 16:32 EST (History)
2 users (show)

See Also:


Attachments
ComboSample (666 bytes, application/octet-stream)
2010-12-15 02:53 EST, pei na CLA
no flags Details
Combo on Windows (10.27 KB, image/png)
2010-12-15 02:54 EST, pei na CLA
no flags Details
Combo on Mac (13.72 KB, image/png)
2010-12-15 02:55 EST, pei na CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description pei na CLA 2010-12-15 02:52:33 EST
Build Identifier: 3.6.2

1.Run ComboSample in atttachment:

final Combo combo = new Combo(shell, SWT.DROP_DOWN | SWT.LEFT_TO_RIGHT);		combo.setText("ABCDEFG.....................................................");

Result:
On Windows, the cursor is at the beginning of the text, which is the expected behavior. But on Mac OS X, the cursor is at the end of the text, it will be hard for use to read the string.

See screenshot in attachment.

Reproducible: Always
Comment 1 pei na CLA 2010-12-15 02:53:48 EST
Created attachment 185205 [details]
ComboSample
Comment 2 pei na CLA 2010-12-15 02:54:45 EST
Created attachment 185207 [details]
Combo on Windows
Comment 3 pei na CLA 2010-12-15 02:55:02 EST
Created attachment 185208 [details]
Combo on Mac
Comment 4 Felipe Heidrich CLA 2010-12-15 10:31:02 EST
Silenio, that should be easy to fix but I'd like to know what gtk does on this same scenario.

Peina, although this seems like a easy fix, we are discontinuing the carbon port. For eclipse 3.7 we will only have cocoa on the mac.
If you need your code to run on 3.6.2 carbon the way you expect, then you should to try to work around this problem on your code. For example, can you call combo#setSelection(new Point(0,0)) after setText() - does it fix the problem you are seeeing ?
Comment 5 Silenio Quarti CLA 2010-12-15 17:12:42 EST
Fixed in Carbon (HEAD). 

GTK works the same as windows. 

Cocoa selects the whole text when the combo gets focus, but shows the beginning of the text, which appropriate platform behaviour.