<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using MAAttachedWindow with an NSStatusItem</title>
	<atom:link href="http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/feed" rel="self" type="application/rss+xml" />
	<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem</link>
	<description>Modesty is Lying</description>
	<lastBuildDate>Sat, 13 Mar 2010 04:52:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: vvlad</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-41900</link>
		<dc:creator>vvlad</dc:creator>
		<pubDate>Thu, 10 Dec 2009 22:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-41900</guid>
		<description>@Luc
	[window setLevel:NSMainMenuWindowLevel];</description>
		<content:encoded><![CDATA[<p>@Luc<br />
	[window setLevel:NSMainMenuWindowLevel];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-41898</link>
		<dc:creator>Manu</dc:creator>
		<pubDate>Thu, 10 Dec 2009 18:59:03 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-41898</guid>
		<description>Does not work for me anymore. I get 

Undefined symbols:
  &quot;_OBJC_IVAR_$_NSStatusItem._fWindow&quot;, referenced from:
      -[NSStatusItem(hack) hackFrame] in ccGpP6n1.o
ld: symbol(s) not found</description>
		<content:encoded><![CDATA[<p>Does not work for me anymore. I get </p>
<p>Undefined symbols:<br />
  &#8220;_OBJC_IVAR_$_NSStatusItem._fWindow&#8221;, referenced from:<br />
      -[NSStatusItem(hack) hackFrame] in ccGpP6n1.o<br />
ld: symbol(s) not found</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-41897</link>
		<dc:creator>Manu</dc:creator>
		<pubDate>Thu, 10 Dec 2009 18:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-41897</guid>
		<description>Does not work anymore. Private instance variable are no exported anymore. So this hack, however useful it was ... well was a hack that worked but no more :)</description>
		<content:encoded><![CDATA[<p>Does not work anymore. Private instance variable are no exported anymore. So this hack, however useful it was &#8230; well was a hack that worked but no more :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luc</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-41637</link>
		<dc:creator>Luc</dc:creator>
		<pubDate>Tue, 10 Nov 2009 03:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-41637</guid>
		<description>Any idea on how to make the window float over the currently running app?

I tried using [NSApp activateIgnoringOtherApps:YES];

While this works, it puts the current app&#039;s window out of focus and when you exit your own window, the focus won&#039;t go back to the other app.

I would like to achieve something like Spotlight or CoverSutra.

Should I use a NSPanel instead of a NSWindow or have a whole different approach?</description>
		<content:encoded><![CDATA[<p>Any idea on how to make the window float over the currently running app?</p>
<p>I tried using [NSApp activateIgnoringOtherApps:YES];</p>
<p>While this works, it puts the current app&#8217;s window out of focus and when you exit your own window, the focus won&#8217;t go back to the other app.</p>
<p>I would like to achieve something like Spotlight or CoverSutra.</p>
<p>Should I use a NSPanel instead of a NSWindow or have a whole different approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Collin Henderson</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-40869</link>
		<dc:creator>Collin Henderson</dc:creator>
		<pubDate>Wed, 18 Mar 2009 16:43:50 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-40869</guid>
		<description>Does anyone know if I could reference objects via Applescript with this? I tried 

set contents of text field &quot;textField&quot; of view &quot;maView&quot; to &quot;foo&quot;

but it didn&#039;t work. I&#039;d like to use this in my Applescript Studio application</description>
		<content:encoded><![CDATA[<p>Does anyone know if I could reference objects via Applescript with this? I tried </p>
<p>set contents of text field &#8220;textField&#8221; of view &#8220;maView&#8221; to &#8220;foo&#8221;</p>
<p>but it didn&#8217;t work. I&#8217;d like to use this in my Applescript Studio application</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Itai Ferber</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-39818</link>
		<dc:creator>Itai Ferber</dc:creator>
		<pubDate>Thu, 02 Oct 2008 01:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-39818</guid>
		<description>Sorry to raise this from the dead, so to speak, but I just wanted to mention that Philip&#039;s solution works really well, and coupled with window fading, it makes for one heck of a menu... :)</description>
		<content:encoded><![CDATA[<p>Sorry to raise this from the dead, so to speak, but I just wanted to mention that Philip&#8217;s solution works really well, and coupled with window fading, it makes for one heck of a menu&#8230; :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthieu Cormier</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-39582</link>
		<dc:creator>Matthieu Cormier</dc:creator>
		<pubDate>Thu, 27 Mar 2008 14:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-39582</guid>
		<description>Philip, you have not sub classed NSStatusItem, you&#039;ve added an extension to the already defined class.

With some slight modifications to MAAttachedWindow, by making the following methods public.
- (void)_updateGeometry;
- (MAWindowPosition)_bestSideForAutomaticPosition;
and making the following variables protected
    @protected
    NSPoint _point;
    MAWindowPosition _side;

I extended MAAttached window and am passing it a point when the user clicks on the menuItem.

@implementation PPAttachedWindow 

-(void)resetClickPoint:(NSPoint)latestPoint {
  _point = latestPoint;
  
  //Get the screen with the menubar
  NSScreen* menuBarScreen = [[NSScreen screens] objectAtIndex:0];
  _point.y = [menuBarScreen frame].size.height + [menuBarScreen frame].origin.y - 20;

  if (_side == MAPositionAutomatic) {
    _side = [super _bestSideForAutomaticPosition];
  }
  
  [super _updateGeometry];  
}

The source kode will be available when I release the next version of ogsPing.

M@</description>
		<content:encoded><![CDATA[<p>Philip, you have not sub classed NSStatusItem, you&#8217;ve added an extension to the already defined class.</p>
<p>With some slight modifications to MAAttachedWindow, by making the following methods public.<br />
- (void)_updateGeometry;<br />
- (MAWindowPosition)_bestSideForAutomaticPosition;<br />
and making the following variables protected<br />
    @protected<br />
    NSPoint _point;<br />
    MAWindowPosition _side;</p>
<p>I extended MAAttached window and am passing it a point when the user clicks on the menuItem.</p>
<p>@implementation PPAttachedWindow </p>
<p>-(void)resetClickPoint:(NSPoint)latestPoint {<br />
  _point = latestPoint;</p>
<p>  //Get the screen with the menubar<br />
  NSScreen* menuBarScreen = [[NSScreen screens] objectAtIndex:0];<br />
  _point.y = [menuBarScreen frame].size.height + [menuBarScreen frame].origin.y &#8211; 20;</p>
<p>  if (_side == MAPositionAutomatic) {<br />
    _side = [super _bestSideForAutomaticPosition];<br />
  }</p>
<p>  [super _updateGeometry];<br />
}</p>
<p>The source kode will be available when I release the next version of ogsPing.</p>
<p>M@</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-39580</link>
		<dc:creator>Philip</dc:creator>
		<pubDate>Tue, 25 Mar 2008 12:42:08 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-39580</guid>
		<description>I&#039;ve been playing around with the NSStatusItem and developed a hack for accessing the StatusItem location.

	@interface NSStatusItem (hack)
		- (NSRect)hackFrame;
	@end
	
	@implementation NSStatusItem (hack)
		- (NSRect)hackFrame
		{
			return [_fWindow frame];
		}
	@end

This simply sub classes the NSStatusItem and add a new method &quot;hackFrame&quot;. Then in your code you simple call:

	NSRect itemRect = [statusItem hackFrame];

statusItem being your object class name. The position of your NSStatusItem is returned in the NSRect.

I&#039;ve been using this to use the genie effect and make my views warp in and out of the status item.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been playing around with the NSStatusItem and developed a hack for accessing the StatusItem location.</p>
<p>	@interface NSStatusItem (hack)<br />
		- (NSRect)hackFrame;<br />
	@end</p>
<p>	@implementation NSStatusItem (hack)<br />
		- (NSRect)hackFrame<br />
		{<br />
			return [_fWindow frame];<br />
		}<br />
	@end</p>
<p>This simply sub classes the NSStatusItem and add a new method &#8220;hackFrame&#8221;. Then in your code you simple call:</p>
<p>	NSRect itemRect = [statusItem hackFrame];</p>
<p>statusItem being your object class name. The position of your NSStatusItem is returned in the NSRect.</p>
<p>I&#8217;ve been using this to use the genie effect and make my views warp in and out of the status item.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Perry</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-39579</link>
		<dc:creator>Ben Perry</dc:creator>
		<pubDate>Tue, 25 Mar 2008 07:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-39579</guid>
		<description>Sorry I should have mentioned that I&#039;m trying to make the MAAttachedWindow appear periodically - not on a mouse event - kinda like growl i guess, but the arrow needs to be pointing at my NSStatusItem. Still possibly without the custom view??</description>
		<content:encoded><![CDATA[<p>Sorry I should have mentioned that I&#8217;m trying to make the MAAttachedWindow appear periodically &#8211; not on a mouse event &#8211; kinda like growl i guess, but the arrow needs to be pointing at my NSStatusItem. Still possibly without the custom view??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Perry</title>
		<link>http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem/comment-page-1#comment-39578</link>
		<dc:creator>Ben Perry</dc:creator>
		<pubDate>Tue, 25 Mar 2008 07:45:11 +0000</pubDate>
		<guid isPermaLink="false">http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem#comment-39578</guid>
		<description>Jordy/Jediknil: I&#039;ve been working on a project using this custom window of Matts and I don&#039;t think you can ditch the custom view. I can&#039;t see another way to find the position of the NSStatusItem to be able to place the MAAttachedWindow properly.

Am I missing something?</description>
		<content:encoded><![CDATA[<p>Jordy/Jediknil: I&#8217;ve been working on a project using this custom window of Matts and I don&#8217;t think you can ditch the custom view. I can&#8217;t see another way to find the position of the NSStatusItem to be able to place the MAAttachedWindow properly.</p>
<p>Am I missing something?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
