[comp.windows.x.motif] Most efficient way of managing children

nazgul@alfalfa.com (Kee Hinckley) (03/19/91)

> I'd like to know what is the most efficient (in time) way of managing
> a tree of widgets.  My guess is that if I want to create, say, a motif
> bulletin board widget with 7 text field children, if I manage the 7
> children (with XtManageChildren), then manage the bulletin board, and
> then realize the top level, this would be most efficient.  Is this
> true?  

Apparently it used to be faster to do the XtManageChildren rather than
create managed, however it doesn't matter so much anymore.  So long
as the parent widget is not managed or realized there is no geometry
negotiation (which is what eats up the time) going on as you add new
children.  The parent only gets notified of new children just prior
to being realized.  So as long as you manage the toplevel last you should
be fine.  The Asente/Swick book covers this quite well btw.

Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

asente@adobe.com (Paul Asente) (03/19/91)

In article <404@bpa44.sbi.com> sivan@bpa44.sbi.com (Sivan Mahadevan) writes:
>I'd like to know what is the most efficient (in time) way of managing
>a tree of widgets.

Before realization, it makes no difference at all whether you manage children
one at a time, in bunches, or all at once.  There is no difference between
creating each child with XtCreateManaged widget and creating each child with
XtCreateWidget and then managing them later with XtManageChildren.

After realization, it is much more efficient to batch management calls up as
much as possible with XtManageChildren.

	-paul asente
		asente@adobe.com	...decwrl!adobe!asente

    Ratz put a bucket of liquid in front of me.
   "I wanted a glass of docs, Ratz.  What the hell is this?" I barked.
   "Motif don't fit in a glass anymore," he barked back.
    I looked at the liquid.  It was totally opaque to me.