I recently encountered a scenario where attempting to set the text for an SWT TableColumn widget fails with an InvocationTargetException / SWTError and the message "Cannot set text". There is nothing special about the column text, i.e. no special characters or mnemonics. It just fails. The same code works for other scenarios.
I took a look at the SWT source for the TableColumn class and found only one place where the "Cannot set text" error is thrown - see code fragment below - but I cannot see why I should have encountered a problem.
Any suggestions as to what the problem may be would be appreciated. Thanks!
Joined: Jul 31, 2001
I think I have found the problem. After performing additional testing, this appears to be a "No more handles" issue although that was NOT the exception message I received initially. Apparently SWT imposes a hard limit that only allows SWT widgets to be nested up to 50 deep. Adding an additional widget, regardless of type, triggers a "No more handles" exception.
subject: SWT TableColumn - SWTError - "Cannot set text"