Bug 4909 - EC: Combo.setText doesn't work on Linux
Summary: EC: Combo.setText doesn't work on Linux
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 16:02 EDT by Grant Gayed CLA
Modified: 2001-10-12 15:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2001-10-11 16:02:42 EDT
I tried the following snip of code on build 0.137 under Linux
and ended up with a combo box that was all gray (no text), though the
entries were there to choose from when I dropped it down:

  Combo combo = new Combo(shell, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN);
  combo.add("one little entry");
  combo.add("two of them");
  combo.add("three is too many");
  combo.setText("two of them");

Note that under Windows, this worked, ie the string "two of them"
appeared in the combo. If I called setText with a string that wasn't
previously added (like combo.setText("not there");), the box stayed gray
since it's read only and must be one of the choices.
Comment 1 Grant Gayed CLA 2001-10-12 15:10:12 EDT
Fixed Motif behaviour to match Windows behaviour.