Previous Next Up Title Contents Index Top Library

4.3.1. REDEFINING MENU

1<shift> 3rdbutton may be redefined to access GPHIGS-GUI.

Example : redefining with button1

/*************************************************************

     Example : redefine key to activate GPHIGS_GUI's popup menu

Steps are :

     - Redefine translation for DisplayGui fonction
     - Use XmNgphigsTranslations ressource

*************************************************************/

#include <Xm/Xm.h>
#include <GPhigsW.h>

static String translation = "\
    <Btn1Down>:DisplayGui()\n";

main () 
{
  Widget toplevel, gphigs ;
  int    n, ac = 0;
  Arg    args[2] ;

  toplevel = XtInitialize ("Essai", "XGphigsgui", NULL, 0, &ac, NULL);

  popen_phigs(PDEF_ERR_FILE, PDEF_MEM_SIZE);
  n = 0;
  XtSetArg(args[n], XmNresizeWs, XmGPHIGS_RESIZE_WS); n++;
  XtSetArg(args[n], XmNguiTranslations,
	XtParseTranslationTable(translation)); n++;

  gphigs = XtCreateManagedWidget(	"GPHIGS",xmGPhigsWidgetClass,toplevel,args,n);

  XtRealizeWidget  (toplevel);
  XtMainLoop();
}

See demonstation program TransW.c


Previous Next Up Title Contents Index Top Library