Joe Sewell
2008-07-29 18:20:56 UTC
I'm writing a composite widget (actually a subclass of XmManager) that
should span the entire width of its parent, unless a resource in the
composite widget itself says otherwise.
The problem is at Initialize time. The parent is doing its initial
geometry negotiations, so its core.width resource is 0. This is
obviously the right answer (or at least not the wrong answer) since
it's trying to determine how wide it needs to be. By the time the
parent knows how wide it wants to be, though, its children (including
my widget) isn't allowed to change its size.
I really don't want to put a StructureNotify event handler on the
parent, and setting up a zero-time timeout or workproc isn't all that
favorable, either. So far, though, those are the only solutions I can
come up with. I *don't* want to depend on the parent doing the heavy
lifting (e.g., forcing the parent to be an XmForm with my widget's
XmNrightAttachment constraint set to XmATTACH_FORM), though that may
be the most palatable solution.
Any suggestions other than those?
should span the entire width of its parent, unless a resource in the
composite widget itself says otherwise.
The problem is at Initialize time. The parent is doing its initial
geometry negotiations, so its core.width resource is 0. This is
obviously the right answer (or at least not the wrong answer) since
it's trying to determine how wide it needs to be. By the time the
parent knows how wide it wants to be, though, its children (including
my widget) isn't allowed to change its size.
I really don't want to put a StructureNotify event handler on the
parent, and setting up a zero-time timeout or workproc isn't all that
favorable, either. So far, though, those are the only solutions I can
come up with. I *don't* want to depend on the parent doing the heavy
lifting (e.g., forcing the parent to be an XmForm with my widget's
XmNrightAttachment constraint set to XmATTACH_FORM), though that may
be the most palatable solution.
Any suggestions other than those?