<?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"
	>
<channel>
	<title>Comments on: Creating a Custom Control with NSView</title>
	<atom:link href="http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/feed/" rel="self" type="application/rss+xml" />
	<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/</link>
	<description>Developing Interfaces with Cocoa</description>
	<pubDate>Fri, 05 Sep 2008 19:45:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-190</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Thu, 22 May 2008 15:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-190</guid>
		<description>Hi J,

Yeah, there are several usability problem with this control...

Your suggestion is really good and I'll give it a try when I get around to updating this project. 

Thanks :)</description>
		<content:encoded><![CDATA[<p>Hi J,</p>
<p>Yeah, there are several usability problem with this control&#8230;</p>
<p>Your suggestion is really good and I&#8217;ll give it a try when I get around to updating this project. </p>
<p>Thanks <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J Nozzi</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-189</link>
		<dc:creator>J Nozzi</dc:creator>
		<pubDate>Thu, 22 May 2008 14:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-189</guid>
		<description>Cathy, this is a great post and I know I'm late to the party, but I think from a usability standpoint, your control is missing something. In the context of the CITwirlDistortion, perhaps it would be good to draw a straight grid within the perimeter of the circle, then distort *it* with CITwirlDistortion depending on the control's setting. 

This way, there's a distinct visual representation of the effect in real time. Intense distortion is immediately distinguished from mild as opposed to relying on the orientation of the drag handle (which gives no cue as to what's "minimum" or "maximum").</description>
		<content:encoded><![CDATA[<p>Cathy, this is a great post and I know I&#8217;m late to the party, but I think from a usability standpoint, your control is missing something. In the context of the CITwirlDistortion, perhaps it would be good to draw a straight grid within the perimeter of the circle, then distort *it* with CITwirlDistortion depending on the control&#8217;s setting. </p>
<p>This way, there&#8217;s a distinct visual representation of the effect in real time. Intense distortion is immediately distinguished from mild as opposed to relying on the orientation of the drag handle (which gives no cue as to what&#8217;s &#8220;minimum&#8221; or &#8220;maximum&#8221;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: L Raney</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-180</link>
		<dc:creator>L Raney</dc:creator>
		<pubDate>Sat, 26 Apr 2008 04:28:21 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-180</guid>
		<description>Great stuff.  There just isn't enough of it out there for new Mac dev people... which is growing.  I have a question, sorry-- I have a multi doc app.  When I create new window with custom view I get keyDown events.  But if I bring into focus previous created window.  keyDown goes to the old window.  - yes I was a windows guy.

Thanks
lar</description>
		<content:encoded><![CDATA[<p>Great stuff.  There just isn&#8217;t enough of it out there for new Mac dev people&#8230; which is growing.  I have a question, sorry&#8211; I have a multi doc app.  When I create new window with custom view I get keyDown events.  But if I bring into focus previous created window.  keyDown goes to the old window.  - yes I was a windows guy.</p>
<p>Thanks<br />
lar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliott Harris</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-125</link>
		<dc:creator>Elliott Harris</dc:creator>
		<pubDate>Sun, 30 Mar 2008 19:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-125</guid>
		<description>Great stuff, I'm really looking forward to your articles concerning Core Animation - I'm a big proponent having done a lot of mixed content (Quartz, Cocoa, and OpenGL) in the past, and it makes it VASTLY easier, and doesn't seem to incur any major performance hit. Nice article. Keep it up.</description>
		<content:encoded><![CDATA[<p>Great stuff, I&#8217;m really looking forward to your articles concerning Core Animation - I&#8217;m a big proponent having done a lot of mixed content (Quartz, Cocoa, and OpenGL) in the past, and it makes it VASTLY easier, and doesn&#8217;t seem to incur any major performance hit. Nice article. Keep it up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Randolph</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-112</link>
		<dc:creator>John C. Randolph</dc:creator>
		<pubDate>Tue, 25 Mar 2008 09:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-112</guid>
		<description>"It always seemed easier to subclass NSView to accomplish my goals, "

That's probably because it is.  ;-)

-jcr</description>
		<content:encoded><![CDATA[<p>&#8220;It always seemed easier to subclass NSView to accomplish my goals, &#8221;</p>
<p>That&#8217;s probably because it is.  <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>-jcr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Randolph</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-111</link>
		<dc:creator>John C. Randolph</dc:creator>
		<pubDate>Tue, 25 Mar 2008 09:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-111</guid>
		<description>"A control is an interface element that allows users to manipulate data in an application."

Well, I'd state it a bit more precisely than that:  in Cocoa, a control is a view that accepts user input events, and has a target, an action, and usually a cell.

Personally, I rarely derive new UI objects directly from NSControl, because it's one of those AppKit classes that has accumulated a *lot* of cruft over the years.  If I'm writing a view that is similar to an existing  control, I'll start there instead.  

One thing that really drives me up the wall about most NSControls w/r/t subclassing them, is that they have a bad habit of grabbing the whole event loop.  Send [super mouseDown:], and it's game over.

-jcr</description>
		<content:encoded><![CDATA[<p>&#8220;A control is an interface element that allows users to manipulate data in an application.&#8221;</p>
<p>Well, I&#8217;d state it a bit more precisely than that:  in Cocoa, a control is a view that accepts user input events, and has a target, an action, and usually a cell.</p>
<p>Personally, I rarely derive new UI objects directly from NSControl, because it&#8217;s one of those AppKit classes that has accumulated a *lot* of cruft over the years.  If I&#8217;m writing a view that is similar to an existing  control, I&#8217;ll start there instead.  </p>
<p>One thing that really drives me up the wall about most NSControls w/r/t subclassing them, is that they have a bad habit of grabbing the whole event loop.  Send [super mouseDown:], and it&#8217;s game over.</p>
<p>-jcr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-92</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Sun, 23 Mar 2008 20:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-92</guid>
		<description>Yes, that's true.  I see what you're saying.  So you would just abandon the cell altogether and do all the same stuff I've done here with NSView.  I'm going to try that out : )</description>
		<content:encoded><![CDATA[<p>Yes, that&#8217;s true.  I see what you&#8217;re saying.  So you would just abandon the cell altogether and do all the same stuff I&#8217;ve done here with NSView.  I&#8217;m going to try that out : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-91</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Sun, 23 Mar 2008 20:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-91</guid>
		<description>Well, you could equally swap between NSControl and NSOpenGLView as superclass, as long as you don't depend on any of the API promised by NSControl. I think there is also no requirement to override any of the NSControl methods when subclassing (although the documentation doesn't clearly state that, I believe).</description>
		<content:encoded><![CDATA[<p>Well, you could equally swap between NSControl and NSOpenGLView as superclass, as long as you don&#8217;t depend on any of the API promised by NSControl. I think there is also no requirement to override any of the NSControl methods when subclassing (although the documentation doesn&#8217;t clearly state that, I believe).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-90</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Sun, 23 Mar 2008 14:52:40 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-90</guid>
		<description>Hi Patrick : )  

It is true that NSControl provides many useful convieniences.  But, I didn't choose NSControl because of the fact that it is an NSView subclass and will only draw with Quartz.  As it is, I could change the example control's super class to NSOpenGLView, replace the Core Graphics drawing code with OpenGL drawing code and it should work the same (I havn't tested that).  I want to leave the example control open to this possibility, even if I didn't take advantage of it in this project, it'll come in handy for an OpenGL example in the future.</description>
		<content:encoded><![CDATA[<p>Hi Patrick : )  </p>
<p>It is true that NSControl provides many useful convieniences.  But, I didn&#8217;t choose NSControl because of the fact that it is an NSView subclass and will only draw with Quartz.  As it is, I could change the example control&#8217;s super class to NSOpenGLView, replace the Core Graphics drawing code with OpenGL drawing code and it should work the same (I havn&#8217;t tested that).  I want to leave the example control open to this possibility, even if I didn&#8217;t take advantage of it in this project, it&#8217;ll come in handy for an OpenGL example in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://katidev.com/blog/2008/03/07/how-to-create-a-custom-control-with-nsview/#comment-89</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Sun, 23 Mar 2008 14:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=67#comment-89</guid>
		<description>Hi Cathy,

Since NSControl is itself a subclass of NSView I would prefer subclassing NSControl. Using an NSCell subclass with your control is optional;not even all of Apple's NSControls use cells, so why should we?

Subclassing NSControl more clearly communicates the role/function of your class, not only to other coders but to the framework as well. For example, one advantage of subclassing NSControl is that it plays nicely with -[NSWindow setMovableByWindowBackground:]. When you make a window movable by its background, it stops passing drag events to NSViews, breaking your KDTwirlDistortionControl. NSControl subclasses, on the other hand, continue to receive these events. It took me quite a while to figure this out, but it does make sense when you think about it.

If it looks like a control, and it works like a control, just subclass NSControl ;-)

Great blog, looking forward to future installments!</description>
		<content:encoded><![CDATA[<p>Hi Cathy,</p>
<p>Since NSControl is itself a subclass of NSView I would prefer subclassing NSControl. Using an NSCell subclass with your control is optional;not even all of Apple&#8217;s NSControls use cells, so why should we?</p>
<p>Subclassing NSControl more clearly communicates the role/function of your class, not only to other coders but to the framework as well. For example, one advantage of subclassing NSControl is that it plays nicely with -[NSWindow setMovableByWindowBackground:]. When you make a window movable by its background, it stops passing drag events to NSViews, breaking your KDTwirlDistortionControl. NSControl subclasses, on the other hand, continue to receive these events. It took me quite a while to figure this out, but it does make sense when you think about it.</p>
<p>If it looks like a control, and it works like a control, just subclass NSControl <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Great blog, looking forward to future installments!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.374 seconds -->
