Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在动态添加 CTabItems,但是当我添加一个新的 CTabItem 并在 CTabFolder 上调用 setSelection 时,它不会调用 CTabFolder 的 selectionListener。是否有任何其他方法可以检测何时将新的 CTabItem 添加到 CTabFolder。任何帮助将不胜感激。
您可以setSelection使用选项卡控件的notifyListeners方法强制发送选择事件:
setSelection
notifyListeners
Event event = new Event(); event.item = theTabItem; tabFolder.notifyListeners(SWT.Selection, event);