From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,12b7dcfd0003f331 X-Google-Attributes: gid103376,public From: jerry@jvdsys.nextjk.stuyts.nl (Jerry van Dijk) Subject: Re: problems with GLUT Date: 1998/11/07 Message-ID: #1/1 X-Deja-AN: 409456689 References: <71vesd$evd$1@nyheter.chalmers.se> Organization: * JerryWare *, Leiden, Holland Newsgroups: comp.lang.ada Date: 1998-11-07T00:00:00+00:00 List-Id: Knut Wannheden (d96knut@dtek.chalmers.se) wrote: : I register the callback with glutCreateMenu(). The callback function is : supposed to take one argument (Integer). The argument of glutCreateMenu is a procedure access type. The procedure accessed takes 1 argument which is an Integer that tells you which entry was selected. Example: Here I create a pop-menu to select a color: ----------------------- -- window color menu -- ----------------------- Color_Submenu := Glut.glutCreateMenu (SelectColor'Unrestricted_Access); Glut.glutAddMenuEntry (Green_String, 1); Glut.glutAddMenuEntry (Red_String, 2); Glut.glutAddMenuEntry (White_String, 3); Activate it as a submenu: Glut.glutAttachMenu (Glut.GLUT_RIGHT_BUTTON); Here is the callback procedure that actually sets the color: ----------------------- -- window color menu -- ----------------------- procedure SelectColor (Color : in Integer) is begin case Color is when 1 => Gl.GlColor3f (0.0, 1.0, 0.0); -- green when 2 => Gl.glColor3f (1.0, 0.0, 0.0); -- red when 3 => Gl.glColor3f (1.0, 1.0, 1.0); -- white when others => null; -- no error handling end case; Glut.glutPostRedisplay; end SelectColor; Jerry. -- -- Jerry van Dijk | email: jdijk@acm.org -- Leiden, Holland | member Team-Ada -- Ada & Win32: http://stad.dsl.nl/~jvandyk