def glutDestroyMenu( cls, menu ): """Destroy (cleanup) the given menu Deregister's the interal pointer to the menu callback returns None """ result = simple.glutDestroyMenu( menu ) contextdata.delValue( ('menucallback',menu) ) return result
def glutCreateMenu( cls, func ): """Create a new (current) menu, return small integer identifier func( int ) -- Function taking a single integer reflecting the user's choice, the value passed to glutAddMenuEntry return menuID (small integer) """ cCallback = cls.callbackType( func ) menu = simple.glutCreateMenu( cCallback ) contextdata.setValue( ('menucallback',menu), (cCallback,func) ) return menu
def fixed_glutCreateMenu(menu_func): """replacement for broken glutCreateMenu""" print MENUFUNC menu = simple.glutCreateMenu(MENUFUNC(menu_func)) return menu