Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Is my window hidden

Is my window hidden
Thread Tools
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 20, 2001, 06:31 AM
 
Is there a way to know if MyWindow is coverd by another window(that belongs to another application).
     
Junior Member
Join Date: Apr 2001
Location: Sunnyvale, CA
Status: Offline
Reply With Quote
Apr 20, 2001, 05:40 PM
 
You don't specify whether you're programming in Carbon or Cocoa, but if you're programming in Carbon, the answer is: No, there is no way.

Can I ask what you need this information for? I can't think of a reason why you would need to know whether a window is being obscurred or not. If a window has to be visible at all times, you should be using global floating windows anyway.
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 21, 2001, 07:36 AM
 
I using Cocoa. Im trying to port xroach to macosx and need to know when the roaches are under a window (when they are hidden). I got the roaches running around the screen just fine. But I need to get them to stop under windows.
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
Apr 21, 2001, 11:37 AM
 
This is beyond the scope of Carbon and Cocoa, I think. The only thing that would have this information would be the window server, so you'd have to drop to the CoreGraphics layer at least.

There does appear to be API to do this, but it currently seems to be private and therefore completely undocumented. You can see the function names by using the nm tool on the framework binary (ApplicationServices.framework/Frameworks/CoreGraphics.framework/CoreGraphics; look for ones that start with "CGS"), but you'd have to figure out all usage by trial and error (what arguments , return values, and types, etc.). Not exactly for the faint of heart.

It's a shame, since I'd love to see a version of xroach. There was one for NEXTSTEP, but it used Display PostScript to get the windowlist info, and of course that API no longer exists.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 21, 2001, 04:44 PM
 
There is an API to find out the bounds of a window, QuartzDebug uses it. You could classdump it possibly... *shrug*
     
Junior Member
Join Date: Apr 2001
Location: Sunnyvale, CA
Status: Offline
Reply With Quote
Apr 22, 2001, 01:40 AM
 
Originally posted by Angus_D:
There is an API to find out the bounds of a window,
That's what you'd probably do if you were finding overlapping windows withing your own app, but with other app's windows I doubt it's possible. In fact, there was a thread on this on the carbon-dev mailing list, and an Apple engineer's reply was that it isn't possible. But they say that, they mean "it's not possible with currently available/supported APIs", so I wouldn't be surprised if it became supported in the future.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 22, 2001, 04:01 AM
 
Just after I posted I realised it doesn't give you any information on layering, so you can't tell which windows are on top, etc. :/

Oh well.... Perhaps someone like louis could suggest it for Orient?
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 22, 2001, 05:13 AM
 
It would be nice if apple included some documents about the windows server and the API's. I love to se xroach and xsnow on macos x. Cant someone thats good on cocoa programming take a look at NXbill, xbill for NeXT and port it to macosx, that would be soo cool.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 22, 2001, 10:36 AM
 
What is xbill?
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 23, 2001, 05:57 AM
 
Xbill is a game, you must protect your computers in the network from bill (gates), he tries to install windows on them. you can download NeXT source on: www.geocities.co.jp/SiliconValley-PaloAlto/8861/nextsoft/ and the x window version on: www.xbill.org .
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Apr 23, 2001, 08:22 AM
 
I'll give a shot at NXBill when I get home.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 23, 2001, 01:19 PM
 
I had a quick look a few weeks ago but it relies on DPS and so, which aren't present on OS X. It looked like it would take more skills than I have to fix it
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 24, 2001, 07:00 AM
 
What relies on DPS and so? NXbill?
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 24, 2001, 12:03 PM
 
Hi, I emailed the man who wrote NSbill, and after a long time he replied this:
Hi, Nice to meet you.

Geran Mannberg wrote:
> Hi, are you planing to port NSbill to MacOS X? It would be fun to see this
> game on Macos X. Have a nice day. bye.
>
> geran mannberg

Now, I'm porting NXBill to Mac OS X.
Its alpha version is running on my machine, but it still has many bugs.
Please wait a few weeks.

Thank you for your message. See you again.

---
ISHIOKA Hiroshi


Its nice to see NeXT developers writing software for macos x. this os rocks =)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2