Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > eee00533ac83fd7ebbf9846dc6d3b77b > files > 238

Io-language-graphics-and-sound-20080330-6.fc15.i686.rpm


<HTML><HEAD><TITLE>Manpage of glutCreateMenu</TITLE>
</HEAD><BODY>
<H1>glutCreateMenu</H1>
Section: GLUT (3GLUT)<BR>Updated: 3.7<BR><A HREF="#index">Index</A>
<A HREF="">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

glutCreateMenu - creates a new pop-up menu. 
<A NAME="lbAC">&nbsp;</A>
<H2>SYNTAX</H2>

<PRE>

int glutCreateMenu(void (*func)(int value));
</PRE>

<A NAME="lbAD">&nbsp;</A>
<H2>ARGUMENTS</H2>

<DL COMPACT>
<DT><I>func</I><DD>
The callback function for the menu that is called when a menu
entry from the menu is selected. The value passed to the
callback is determined by the value for the selected menu
entry. 
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>DESCRIPTION</H2>

glutCreateMenu creates a new pop-up menu and returns a unique
small integer identifier. The range of allocated identifiers starts at
one. The menu identifier range is separate from the window
identifier range. Implicitly, the current menu is set to the newly
created menu. This menu identifier can be used when calling
glutSetMenu. 

When the menu callback is called because a menu entry is selected
for the menu, the current menu will be implicitly set to the menu
with the selected entry before the callback is made. 
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLE</H2>

Here is a quick example of how to create a GLUT popup menu with
two submenus and attach it to the right button of the current window:
<PRE>

  int submenu1, submenu2;

  submenu1 = glutCreateMenu(selectMessage);
  glutAddMenuEntry(&quot;abc&quot;, 1);
  glutAddMenuEntry(&quot;ABC&quot;, 2);
  submenu2 = glutCreateMenu(selectColor);
  glutAddMenuEntry(&quot;Green&quot;, 1);
  glutAddMenuEntry(&quot;Red&quot;, 2);
  glutAddMenuEntry(&quot;White&quot;, 3);
  glutCreateMenu(selectFont);
  glutAddMenuEntry(&quot;9 by 15&quot;, 0);
  glutAddMenuEntry(&quot;Times Roman 10&quot;, 1);
  glutAddMenuEntry(&quot;Times Roman 24&quot;, 2);
  glutAddSubMenu(&quot;Messages&quot;, submenu1);
  glutAddSubMenu(&quot;Color&quot;, submenu2);
  glutAttachMenu(GLUT_RIGHT_BUTTON);
</PRE>

<P>

<A NAME="lbAG">&nbsp;</A>
<H2>X IMPLEMENTATION NOTES</H2>

If available, GLUT for X will take advantage of overlay planes for
implementing pop-up menus. The use of overlay planes can
eliminate display callbacks when pop-up menus are deactivated. The
SERVER_OVERLAY_VISUALS convention is used to determine
if overlay visuals are available. 
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>

glutCreateWindow, glutDestroyMenu, glutSetMenu, glutAttachMenu
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHOR</H2>

Mark J. Kilgard (<A HREF="mailto:mjk@nvidia.com">mjk@nvidia.com</A>)
<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNTAX</A><DD>
<DT><A HREF="#lbAD">ARGUMENTS</A><DD>
<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
<DT><A HREF="#lbAF">EXAMPLE</A><DD>
<DT><A HREF="#lbAG">X IMPLEMENTATION NOTES</A><DD>
<DT><A HREF="#lbAH">SEE ALSO</A><DD>
<DT><A HREF="#lbAI">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="">man2html</A>,
using the manual pages.<BR>
Time: 19:05:09 GMT, September 15, 2003
</BODY>
</HTML>