BASIC

Author Topic: window is not responding  (Read 201 times)

Offline FaSe

  • Mc. Print
  • *
  • Posts: 2
    • View Profile
    • FaSe Acoustic
window is not responding
« on: 2017-Apr-11 »
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



« Last Edit: 2017-Apr-11 by FaSe »
FaSe Acoustic

-the science of sound-

Offline dreamerman

  • Mr. Polyvector
  • ***
  • Posts: 123
    • View Profile
    • my personal website
Re: window is not responding
« Reply #1 on: 2017-Apr-11 »
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

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3922
    • View Profile
    • Portfolio
Re: window is not responding
« Reply #2 on: 2017-Apr-11 »
I wonder if adding SHOWSCREEN to all or the longer for next loops could resolve this issue.

Offline FaSe

  • Mc. Print
  • *
  • Posts: 2
    • View Profile
    • FaSe Acoustic
Re: window is not responding
« Reply #3 on: 2017-Apr-11 »
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 Acoustic

-the science of sound-

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3922
    • View Profile
    • Portfolio
Re: window is not responding
« Reply #4 on: 2017-Apr-11 »
Glad to hear all is fine. Code on! :good:

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3922
    • View Profile
    • Portfolio
Re: window is not responding
« Reply #5 on: 2017-Apr-12 »
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.