O.K.
I've managed to write a simple X app that creates a window with a menu,
with sub-menu's
I have even managed to register callbacks for a submenu item's Arm, Disarm,
Activate messages.
I see the printf(); messages for these events.
I also tried to register for Create and Destroy, but they don't seem to get
called. (I get no corresponding printf() messages)
Below are the relevant code snippets
Any explanations ??
/*newItem is the file..new menu item */
newItem = XmCreatePushButton ( fileMenu, "newItem", al, ac );
/* here I register the callbacks for newItem*/
XtAddCallback( newItem, XmNactivateCallback, OnFileNew, 0 );
XtAddCallback( newItem, XmNarmCallback, OnFileNew_Arm, 1 );
XtAddCallback( newItem, XmNdisarmCallback, OnFileNew_DisArm, 2);
XtAddCallback( newItem, XmNcreatePopupChildProc, OnFileNew_Create, 3 ); /*I
presume this is the create Callback ?!?!?! */
XtAddCallback( newItem, XmNdestroyCallback, OnFileNew_Destroy, 4 );
/*here are the various callback handlers*/
void OnFileNew_Arm(Widget w, XtPointer client_data, XtPointer xt_call_data)
{
XmPushButtonCallbackStruct *call_data = (XmPushButtonCallbackStruct
*) xt_call_data ;
printf("OnFileNew_Arm\n");
}
void OnFileNew_DisArm(Widget w, XtPointer client_data, XtPointer
xt_call_data)
{
XmPushButtonCallbackStruct *call_data = (XmPushButtonCallbackStruct
*) xt_call_data ;
printf(" OnFileNew_DisArm\n");
}
void OnFileNew_Create(Widget w, XtPointer client_data, XtPointer
xt_call_data)
{
XmAnyCallbackStruct *call_data = (XmAnyCallbackStruct *)
xt_call_data ;
printf("OnFileNew_Create\n");
}
void OnFileNew_Destroy(Widget w, XtPointer client_data, XtPointer call_data)
{
printf(" OnFileNew_Destroy\n");
}
void OnFileNew(Widget w, XtPointer client_data, XtPointer xt_call_data)
{
XmPushButtonCallbackStruct *call_data = (XmPushButtonCallbackStruct
*) xt_call_data ;
printf("OnFileNew\n");
}
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender. You must not, directly or indirectly, use, disclose, distribute,
print, or copy any part of this message if you are not the intended
recipient. CREDIT SUISSE GROUP and each of its subsidiaries each reserve
the right to monitor all e-mail communications through its networks. Any
views expressed in this message are those of the individual sender, except
where the message states otherwise and the sender is authorised to state
them to be the views of any such entity.