"Smith, Jack" wrote:
[snip]
>
> I also tried to register for Create and Destroy, but they don't seem to get
> called. (I get no corresponding printf() messages)
>
[snip]
>
> XtAddCallback( newItem, XmNcreatePopupChildProc, OnFileNew_Create, 3 ); /*I
> presume this is the create Callback ?!?!?! */
No; how could one set a create callback *after* creation? The most one
could
ask for would be an XmNrealizeCallback or an XmNchangeManagedCallback.
These
would be quite useful, but alas, the MIT guys did not put them in Core.
One has
to resort to kludges based on EventHandlers (anyone knows a more elegant
solution?)
XmNcreatePopupChildProc is a Shell resource, see "man Shell", and is
called,
not *on* creation but *to* create a popup menu on the fly. It is not a
callback.
<PETPEEVE>
Why oh why, does the reference implementation of Xt (actually the
only one, I think) allow attempts to set inappropriate resources
for a widget without any kind of error reporting?
</PETPEEVE>
>
> XtAddCallback(newItem, XmNdestroyCallback, OnFileNew_Destroy, 4 );
>
See "man core". The destroyCallback will only be called when you call
XtDestroyWidget on newItem or one of its ancestors, which your code does
not
seem to do.
Greetings.
--
Michel Bardiaux