SWT: How to detect when a new CTabItem is added to CTabFolder?

160 views Asked by At

I am adding CTabItems dynamically, but when I add a new CTabItem and call setSelection on CTabFolder, it doesn't call selectionListener of CTabFolder. Is there any other way to detect when a new CTabItem is added to CTabFolder. Any help will be appreciated.

1

There are 1 answers

0
greg-449 On

You can force a selection event to be sent when you do the setSelection by using the tab control's notifyListeners method:

Event event = new Event();
event.item = theTabItem;
tabFolder.notifyListeners(SWT.Selection, event);