FormToolkit.adapt() failure [message #296636] |
Wed, 28 December 2005 13:27 |
Eclipse User |
|
|
|
R3.1.1, WinXP
I've used FormToolkit several times with success, and have Trees and Texts and Buttons etc. all nice
and "formy". In each case, if I create like this:
_formToolkit = new FormToolkit(parent.getDisplay());
_theForm = _formToolkit.createForm(parent);
_body = _theForm.getBody();
When I can, I use _formToolkit.createFoobar(_body, ...), but I also successfully use the other
possibility, _formToolkit.adapt(createTopLevelComposite(_body, ...)), where of course
createTopLevelComposite() is just my code, and for example creates a CTabFolder containing 1..N
CTabItem's each containing one Tree.
Now I create a new set of widgets (wrapped in a class for convenience), and attempt to adapt the
top-level Composite, as above -- and it fails: the children have grey (not white) backgrounds.
My new set of widgets is a nested containment hierarchy of CLabel and Text items. So I guess, maybe
my containment hierarchy needs to explicitly setBackground(parent.getBackground()) -- guessing that
Tree, CTabItem, and CTabFolder just happen to do that automagically, whereas CLabel and Text do not.
But that fails too. What works, is at each level of my containment hierarchy, to do the following:
final Control[] kids = control.getChildren();
for (final Control kid : kids) {
tk.adapt(kid, true, true);
}
But I am pretty sure that should not ne needed. So what am I doing wrong?
Thanks,
Paul
|
|
|
Powered by
FUDForum. Page generated in 0.17166 seconds