Seeing if turing window is top on screen?
Author |
Message |
Fexter
|
Posted: Tue Mar 20, 2012 10:08 pm Post subject: Seeing if turing window is top on screen? |
|
|
What is it you are trying to achieve?
I want to find if my Turing program is on top of the screen, so that I can only have it detecting mouse clicks if I am running the window.
What is the problem you are having?
I have a program that's proceeding after finding a mouse click, thinking it was on the Turing window, even if I have the window minimized and have gone to a different window.
Describe what you have tried to solve this problem
I tried looking for anything that would be capable of doing this, but couldn't find anything.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
var curX, curY, curZ : int
procedure waitForButtonDown (var x,y,z : int)
loop
Mouse.Where(x, y, z )
% if Window.IsTop(defWinId) then %
exit when z not= 0
end loop
end waitForButtonDown
loop
waitForButtonDown (curX, curY, curZ )
drawfilloval(curX, curY, 5, 5, black) % This is running even if the window is minimized, so going back to it makes a mess on the screen
end loop
|
Please specify what version of Turing you are using
I am using Turing 4.1. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dreadnought
|
Posted: Wed Mar 21, 2012 12:25 am Post subject: Re: Seeing if turing window is top on screen? |
|
|
What you're looking for is in the windowmodule, the window that is "on top" is called the "active" window. You can check if the Turing window is the active window and you can also set the active window. |
|
|
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Wed Mar 21, 2012 10:24 am Post subject: RE:Seeing if turing window is top on screen? |
|
|
Window.GetActive |
|
|
|
|
![](images/spacer.gif) |
|
|