Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] setSelection()???

Karlis Zigurs wrote:

Hello,

I'm currently writing an auto completing combo box, and I have stubbed on unpleasant surprise - setSelection don't works as expected (it makes no difference at all). getSelection.toString shows that setting happens correctly, but text ether gets no selection or stays selected by default.
Is it really unimplemented or maybe I'm trying something wrong?
---
offending code:
            if (entries[i].toLowerCase().startsWith(text.toLowerCase())) {
                getCombo().select(i); //select, not setText. Else recursion thru ModifyListener starts
                Point selection = new Point(text.length() - 1, entries[i].length() - 1);
                getCombo().setSelection(selection);
                return;
            }

Respectfully,
Karlis Zigurs

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev

Karlis,
X Y In point can be only problem.
Have you tried with only call to
getCombo().select(i) and commenting line which uses setSelection
Also can try calling combo.redraw after call to select
Let me know if it helps.

-Hemant




Back to the top