Silverfrost Forums

Welcome to our forums

How to EXIT the program

30 May 2008 11:53 #3285

In main program I made simple handle menu in OpenGl Window as:

.........................................
i=winio@('%es%sv%sp%ww[no_caption,no_sysmenu,no_border]%pv%^og[DOUBLE]%lw',xo1,yo1,xo2,yo2,opengl_proc,ctrl)
.........................................
i=glutCreateMenu (menu)
call glutAddMenuEntry ('MAKE BMP',1)
call glutAddMenuEntry ('EXIT',2)
Icall glutAttachMenu (GLUT_RIGHT_BUTTON)
.........................................

and in subroutine I've wroten:

integer function myexit ()
include <opengl.ins>
integer ctrl

write(*,*) 'I AM IN'

        call glutDestroyWindow(i)
        ctrl = 0
        call window_update@(ctrl)
        myexit = 0

write(*,*) 'I AM OUT'
end function myexit 

By pushing right button mouse th epossition in the menu 'EXIT' I would like to EXIT the program closing OpenGl window too. Bu it doesn't work ?

30 May 2008 12:34 #3287

One possible reason is that ctrl must not be local to the routine. It must be in a COMMON block (or a MODULE perhaps) and must the same ctrl that is attached to the control variable of the main window.

30 May 2008 8:23 #3289

Thank you very much it works exelent.

Please login to reply.