Three other things: 1) You don't need to set the object disabled to add it to
another object. 2) You can send messages to "application" instead of "App".
It's a reserved word just like "process" or "self". In your case "App" is a
shorter name and simpler. In my apps I always have longer names for the
objects and so "application" is a nice shortcut. 3) To reduce code size you
can construct the optr once and refer to the variable name. However, you're
going to save the optr in MSG_GEN_DOCUMENT_INITIALIZE_DOCUMENT_FILE anyway
and won't need to construct it again in
MSG_GEN_DOCUMENT_ATTACH_UI_TO_DOCUMENT. Just pointing out the opportunity for
optimization.
Nathan