Re: stack problems kinda figured out
Paul Chen (chen@geoworks.com)
Thu, 2 Jan 1997 10:19:21 -0800 (PST)
GWRepCami writes:
> In a message dated 97-01-01 17:17:08 EST, edwdig@bergen.org (Edward Di
> Geronimo Jr.) writes:
>
> > (the variables are all declared correctly)
> >
> > newitem = ObjInstantiate(ObjectBlock, (ClassStruct *)&BasicItemClass);
> > @call ObjectList::MSG_GEN_ADD_CHILD(newitem, (CCF_MARK_DIRTY | CCO_LAST));
> > @call newitem::MSG_GEN_ITEM_SET_IDENTIFIER(1);
> > @call newitem::MSG_GEN_SET_USABLE(VUM_NOW);
> > @call newitem::MSG_GEN_SET_ENABLED(VUM_NOW);
> >
>
> Edward, something about this code snippet was bothering me, and I finally saw
> it, as it's different from something I'm doing, which to be honest, is
> something similar to what you're doing. Here's my code snippet, and if you
> look at it, I think you'll see what is different:
>
> ----snip----
> @method UIPrimClass, MSG_CREATE_NEW_PRIMARY
> {
> optr newPrim;
>
> newPrim = ObjInstantiate(OptrToHandle(oself),
> (ClassStruct *)&GenPrimaryClass);
>
> pself = ObjDerefGen(oself);
>
> @call self::MSG_GEN_ADD_CHILD(newPrim, (CCF_MARK_DIRTY | CCO_LAST));
> @call newPrim::MSG_GEN_SET_USABLE(VUM_DELAYED_VIA_UI_QUEUE);
> @call newPrim::MSG_GEN_SET_ENABLED(VUM_NOW);
>
> }
> ---------------snip---------------
>
> You are updating your object too soon by setting it usable(VUM_NOW) rather
> than (VUM_DELAYED_VIA_UI_QUEUE);
>
> If you change this, you may find you have a little less problem with your
> object.
Just a short note:
You should almost always use VUM_DELAYED_VIA_APP_QUEUE when you need to
pass a VisUpdateMode. This puts your update event into your app's queue.
The Geometry Manager can combine related update events in your app's queue
and perform a single redraw event. You should only use VUM_NOW if you
have but a single update to do -- a series of VUM_NOW updates wastes time
and looks awkward (screen flashes multiple times as each update is redrawn).
You shoud NOT be using VUM_DELAYED_VIA_UI_QUEUE -- this puts the redraw
event in the ui geode's queue. The ui geode is the system geode that
handles the specific ui on your hardware device. So, VUM_DELAYED_VIA_-
UI_QUEUE is really only for system use.
I apologize if this point wasn't made clearly enough either in the
training class (Geos Programming I), or in the technical documentation.
pc