window is not responding

Previous topic - Next topic

FaSe

Hey guys,

I'm developing an acoustic simulation software, which uses loudspeaker measurements to simulate the interaction of different loudspeakers in a simple venue. So far everything is working fine. It's still in it's infancy so I have some bugs to fix. One of those is the following problem:

Everytime I activate the simulation and I click on my software's window, it says "window is not responding" but in the background my calculation runs fine. When I wait a little it gives me the right results.

(If you need a picture of it: http://fase-acoustic.com/dBCalc/debug.bmp)

The calculation is based on a few FOR - NEXT Loops and it calculates every pixel for every loudspeaker. Sure that it takes some time but I have no Idea why windows always thinks that my software is not responding.

Do you have any Ideas??

Thanks in anticipation



FaSe Acoustics

-the science of sound-

dreamerman

Generally if you don't need gui/window stuff you can write cmd/console application that will do same. If I understood correctly, your GLB app stars normally, then you activate (by click or whatever) calculation routines - those FOR based, and they took some time let's say 10seconds, in that time your app window is marked as 'not responding', and it's proper beheviour, remember if an application has a window it needs to proceed windows messages whole time, if it doesn't do that for particular time, it's marked as 'not responding', (VisualBasic there was easy solution for that - DoEvents() function, but GLB is different beast), after those loops end, application is again marked as normal as it handles windows messages on time. It's working same way in all languages.
Either use console app, or redesign your main loop: use LimitFps, put calculations to GLB_ON_LOOP sub and limit them so they would not take more than 1000/limitfps, and so on... Also maybe some optimizations in your loops could be done.
Check my source code editor for GLBasic - link Update: 20.04.2020

erico

I wonder if adding SHOWSCREEN to all or the longer for next loops could resolve this issue.

FaSe

Thanks a lot  :)

your Idea with Showscreen was the solution...
in my case I used "gui_pump()" because of the native gui library but that worked fine

Tank you guys for your fast response!

;)
FaSe Acoustics

-the science of sound-

erico

Glad to hear all is fine. Code on! :good:

erico

There has been some discussion of similar subject before. It seems that SHOWSCREEN is a command that responds to the OS for such (ye, the original post).
@dreamerman ´s take is also to be considered, might come in hand specially if mobiles are to be targeted.