Article # 215, added by Geoworks, historical record
| first | previous | index | next | last |

What messages are good for initializing objects or the application?



Depending on what you want to initialize, there are several messages 
that can be used.

For general application startup/shutdown work, use
	MSG_GEN_PROCESS_OPEN_APPLICATION & MSG_GEN_PROCESS_CLOSE_APPLICATION

For specific generic objects, use
	MSG_VIS_OPEN & MSG_VIS_CLOSE
	MSG_SPEC_BUILD 

For dialogs, use
	MSG_GEN_INTERACTION_INITIATE & MSG_GEN_GUP_INTERACTION_COMMAND

For any object that you create dynamically, you can handle
	MSG_META_INITIALIZE.

In special cases, register on the MGCNLT_ACTIVE_LIST GCN list and handle
	MSG_META_ATTACH & MSG_META_DETACH


MSG_GEN_PROCESS_OPEN_APPLICATION is commonly used for setting up a
variety of things (opening an application specific vmfile for example).
Generally, you will want to do your specific processing after calling
the super class handler.

MSG_VIS_OPEN is sent to an object each time it or the tree that it is
in is visually built out.  This is usually once per launching of the
application.  Although it will not necessary occur when the application
is first launched.

MSG_SPEC_BUILD is similar to MSG_VIS_OPEN, but gets sent to generic
objects to tell them to build out their specific UI portions.

MSG_GEN_INTERACTION_INITIATE actually initiates bringing the dialog
onscreen.  Handle MSG_GEN_GUP_INTERACTION_COMMAND and watch for 
IC_DISMISS to determine when the dialog is being brought offscreen.

MSG_META_INITIALIZE is only sent when a master class part of the
object is created.  When an object is statically defined, the Gen part
is already created statically, but the Vis part is not.  Hence when 
the app starts, MSG_META_INITIALIZE is sent to the Vis part (which
bypasses your attempt to handle the message) but not the Gen part.
If you dynamically instantiate an object MSG_META_INITIALIZE will be
sent to the Gen part as well.

MSG_META_ATTACH and MSG_META_DETACH are received by an objects that
subscribe to the MGCNLT_ACTIVE_LIST.  This is really only necessary
for special cases, like a library that creates an object and wants
notification for when that object is attached and detached from an
application's object tree.