Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Nov 12, 2019 3:54 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Detect where my App is in DOCK
PostPosted: Mon Nov 19, 2012 7:31 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Is there a way for an app to locate the exact screen position of its own icon in the OSX dock?

I want to be able to open a window directly above the icon (or the left/right/bottom if the user moved the dock around)

basically the same X/Y position as the right click OSX menu appears..

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 6:19 am 
Offline
User avatar

Joined: Wed Oct 05, 2005 1:21 pm
Posts: 515
Location: United Kingdom
That doesn't seem standard behaviour. What are you trying to achieve?

_________________
Gorgeous REALbasic controls from Figa Software | My Flickr | My Blog
11" MacBook Air 1.8Ghz i7, 4GB RAM, OSX 10.8.2, RB 2012 r1.1 Pro | iPhone 4S 32GB | Nikon D60


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 8:24 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
What I am trying to achieve or the fact that is or is not "standard behaviour" wasn't the question.

The question was how to detect the location of the program icon in the dock. Possible yes or no.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 8:47 am 
Offline

Joined: Mon Apr 10, 2006 3:02 am
Posts: 52
DaveS wrote:
What I am trying to achieve or the fact that is or is not "standard behaviour" wasn't the question.

The question was how to detect the location of the program icon in the dock. Possible yes or no.


Look here

http://decio.eu/2012/03/27/dockutil-le- ... -dock-osx/


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 8:57 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Thanks.... should have qualified... "without using 3rd party utilities".

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 2:31 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
You could look at defaults read com.apple.dock

Find the dock orientation (left, right, bottom). Find the tile size. Find the center point of the display. Count where your icon sits in relation to other icons. Do the math.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 3:22 pm 
Offline
Real Software Engineer

Joined: Fri Jan 28, 2011 5:24 pm
Posts: 145
pony wrote:
You could look at defaults read com.apple.dock

Find the dock orientation (left, right, bottom). Find the tile size. Find the center point of the display. Count where your icon sits in relation to other icons. Do the math.


Please don't do this, the Dock user defaults are not a public API and could change at any point. You might try using OS X's accessibility APIs to accomplish this, but I can't think of any other application that uses such a user interface (which is typically a good indicator that it has flaws).

_________________
Joe Ranieri
Mac Frameworks & Compiler
REAL Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 3:29 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Quote:
but I can't think of any other application that uses such a user interface (which is typically a good indicator that it has flaws).


Uh..... FINDER?????
the only difference is I want to "click".... since Finder already intercepts "right click"

AppleEvents notifiies of when the click occurs.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 4:31 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Pretty confident you're not going to find a way to do this.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 4:37 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
LOL
a challenge?
You're on.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 4:43 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
You'll probably have more luck taking a screenshot and literally searching for your icon. Needless to say, performance will suck, and you'll have trouble even taking the screenshot without relying on something outside of the product.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 6:08 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
Dave, take a look at the app DockView. It displays thumbnails of open windows when you point at an app's Dock icon. Is this along the lines of what you're trying to achieve?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 6:35 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
ktekinay wrote:
Dave, take a look at the app DockView. It displays thumbnails of open windows when you point at an app's Dock icon. Is this along the lines of what you're trying to achieve?


Not "exactly"... but the X/Y pos where the thumbnails in DockView are shown is the information I am trying to get.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 6:54 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
Right, as I thought. Unfortunately, I have no idea how he does it, but perhaps the author will be willing to share.

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Detect where my App is in DOCK
PostPosted: Tue Nov 20, 2012 6:58 pm 
Offline
Real Software Engineer

Joined: Fri Jan 28, 2011 5:24 pm
Posts: 145
It uses the accessibility APIs that I mentioned.

_________________
Joe Ranieri
Mac Frameworks & Compiler
REAL Software, Inc.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group