我从 SWT 编程开始,我正在尝试重新编程这个示例,其中CTabItem
's 是在CTabFolder
. 但是由于我是 GUI 编程的菜鸟,所以有些事情对我来说很不清楚。
a的目的setData()
和用途setControl()
是CTabItem
什么?我在哪些情况下或在哪些情况下使用这些方法?我已阅读 setData 的 API 文档,其中说:
Sets the application defined widget data associated with the receiver to be the argument. The widget data is a single, unnamed field that is stored with every widget.
但我不明白这一点以及setControl
. 谁能解释一下这些方法的目的?