/*
 * $Header: /cvsroot/hungry/lesstif/test/Xm/menushell/test8.c,v 1.1 1998/10/27 00:39:48 pgw Exp $
 */
#include <Xm/Xm.h>
#include <Xm/RowColumn.h>
#include <Xm/Label.h>
#include <Xm/PushB.h>

#include <stdio.h>

Widget label, toplevel, popup, button1, button2;
XtAppContext theApp;

char *fallback[] = {
        "*button1.labelString:                  Button 1",
        "*button1.mnemonic:                     B",
        "*button1.acceleratorText:              Ctrl-B",
        "*button1.accelerator:                  Ctrl<Key>b",
        "*button2.labelString:                  Button 2",
        "*button2.mnemonic:                     u",
        "*button2.acceleratorText:              Ctrl-U",
        "*button2.accelerator:                  Ctrl<Key>U",
        NULL   
};
 
int
main(int argc,
     char **argv)
{
  Arg args[2];
  int nargs;
  String menuPost = NULL;
  unsigned int foo;

  toplevel = XtAppInitialize(&theApp,
			     "test12",
			     NULL, 0,
			     &argc, argv,
			     fallback, NULL, 0);

  label = XtVaCreateManagedWidget("label",
				  xmLabelWidgetClass,
				  toplevel,
				  NULL);

  nargs = 0;
#if XmVERSION > 1
  XtSetArg(args[nargs],XmNpopupEnabled,XmPOPUP_AUTOMATIC_RECURSIVE);
  ++nargs;
#endif
  popup = XmCreatePopupMenu(label,
                            "popup",
                           args,nargs);
  XtManageChild(popup);

  XtVaSetValues(popup, XmNwhichButton, 3, NULL);

  button1 = XtVaCreateManagedWidget("button1",
				    xmPushButtonWidgetClass,
				    popup,
				    NULL);

  button2 = XtVaCreateManagedWidget("button2",
				    xmPushButtonWidgetClass,
				    popup,
				    NULL);

  XtRealizeWidget(toplevel);

  {
    static XtWidgetGeometry Expected[] = {
      CWWidth | CWHeight            ,   57,   73,   34,   17, 0,0,0, /* label */
    };
    /* toplevel should be replaced with to correct applicationShell */
    PrintDetails(toplevel, Expected);
  }
  LessTifTestMainLoop(toplevel);

  exit(0);
}
