View Full Version : has NSView changed
munkees
Jul 18, 2006, 12:47 AM
I am learning Cocoa with Objective-c using the book, I am in chapter 8 which has a Dot View program, it use NSBezier, the book was writen for Mac OS X 10.2 I am using xcode 2.3 on Tiger. When I run the program it does not draw the dot.
Has the x/y start point moved from the bottom left corner?
Just don't under stand why it does not display any Ideas
robbieduncan
Jul 18, 2006, 03:45 AM
Nope. According to the documentation (at file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/CocoaDrawingGuide/index.html on your harddrive under a normal XCode install) the coordinate system is still based from the bottom left.
HiRez
Jul 18, 2006, 11:32 AM
As to why it does not display, posting your drawing code may help. There are a number of things that could cause it not to display (including your drawRect or other drawing method never being called at all).
slooksterPSV
Jul 18, 2006, 12:03 PM
You need to update the view, so let's say the mouse clicked on the view, in the mouseDown method put this at the end:
[self setNeedsDisplay:YES];
Whatever tells NSView to display put:
[viewObject setNeedsDisplay:YES];
if you are calling it from a function outside of NSView.
savar
Jul 18, 2006, 01:47 PM
I am learning Cocoa with Objective-c using the book, I am in chapter 8 which has a Dot View program, it use NSBezier, the book was writen for Mac OS X 10.2 I am using xcode 2.3 on Tiger. When I run the program it does not draw the dot.
Has the x/y start point moved from the bottom left corner?
Just don't under stand why it does not display any Ideas
It is possible to flip the coordinate system.
I suggest you post your code.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.