forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to EXIT the program

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
leszpol



Joined: 25 Apr 2008
Posts: 29
Location: Gdynia-TriCity

PostPosted: Fri May 30, 2008 12:53 pm    Post subject: How to EXIT the program Reply with quote

In main program I made simple handle menu in OpenGl Window as:
Code:
     
.........................................
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:
Code:

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 ?
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Fri May 30, 2008 1:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
leszpol



Joined: 25 Apr 2008
Posts: 29
Location: Gdynia-TriCity

PostPosted: Fri May 30, 2008 9:23 pm    Post subject: Re: Reply with quote

Thank you very much it works exelent.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group