[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] When can setFocus return false?

Hi,

I am driving SWT UI by sending some messages from non-swt thread via Display.syncExec. This seems to work quite well, but I have a problem with the setFocus method: it behaves inconsistently. When invoking setFocus on the same control (Text in my case), I sometimes get false, sometimes true (true in most cases).
If I re-try on false, I usually succeed next time (but I have to do it in next syncExec - i.e. giving SWT thread some time off).


I found out, that setFocus returns false, when the control is disabled - but it doesn't seem to be my case.

Are there some other conditions, under which a control can refuse focus (and which can change during the control lifetime)? (I am on Windows, Eclipse 3.0).

Thanks for suggestions,

Michal