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 

TIMER and MOUSE_MOVE interfere in callback

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



Joined: 26 Mar 2005
Posts: 57

PostPosted: Tue Aug 16, 2022 2:30 pm    Post subject: TIMER and MOUSE_MOVE interfere in callback Reply with quote

I try to develop a certain simulation using clearwin+. The callback to my OpenGL- window is triggered at regular intervals by a %dl-timer. I check for 'TIMER' as callback reason and then perform a new cycle of my simulation with corresponding window updates. This may take some time and runs continuously when I run what I call real-time-mode.

My OpenGL-Window covers a substantial portion of my screen and it cannot be avoided that while operating controls the mouse touches this graphic window which invokes the callback once again while it is still active. This leads to an error message and the prog aborts execution.

Of course, there is a workaround to create another window which does timecontrol only and minimize it. But is there a more elegant solution, like locking the callback while it is active performing a lenghty job?
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 539
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Aug 16, 2022 3:27 pm    Post subject: Reply with quote

This earlier post may be of some help.

http://forums.silverfrost.com/viewtopic.php?t=3992

i.e. this part:

If a routine is being entered against your wishes then you could put a SAVEd logical variable at the start of it. Set this .TRUE. on the first entry and exit immediately on reentry so that the routine is only executed at the first level.

Code:
SUBROUTINE sub(....)
LOGICAL,SAVE:: active
!!DATA statement to initialise active to .FALSE.
IF(active) RETURN
active = .TRUE.
!! Body of subroutine
active = .FALSE.
END SUBROUTINE
Back to top
View user's profile Send private message Visit poster's website
ursuselasticus



Joined: 26 Mar 2005
Posts: 57

PostPosted: Tue Aug 16, 2022 3:42 pm    Post subject: Reply with quote

Thanks, Kenneth. Works fine.
I did not think of the SAVE-Attribute.

Norbert
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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