problems updateing a glut menu

Hey guys,

I have created a sub menu using glut and the right click. But i am trying to update the values of this menu. I cant for the life of me get this to work, the reason i want to do this is sometimes during the application i might create another object, this object when created should be added to the sub menu.

This is what i am trying:

   glutSetWindow(sub_info);
   callback_infoMenu();

This seems to work, but in the console if get this: (i should point out i am also using sub windows, and each suvb window has a different menu attached)


GLUT: Warning in D:\Files\Final Year Project\code folders\Version 8\Version 8.5\
Debug\Version 8.5.exe: glutSetWindow attempted on bogus window.
GLUT: Warning in D:\Files\Final Year Project\code folders\Version 8\Version 8.5\
Debug\Version 8.5.exe: glutSetWindow attempted on bogus window.
Press any key to continue

I cant seem to sort this out.

Any help would be appreciated.

To me it looks like the id (the integer assigned from glut) of sub_info is not right. Can you verify that when you call glutCreateSubWindow you get a good id and that in the call to glutSetWindow the value is still the same?
Maybe you can try
glutGetWindow(sub_info) to be sure you have a good value before you try to set it.