has NSView changed

Discussion in 'Mac Programming' started by munkees, Jul 17, 2006.

  1. macrumors 65816

    munkees

    Joined:
    Sep 3, 2005
    Location:
    Pacific Northwest
    #1
    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
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
  3. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #3
    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).
     
  4. macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #4
    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.
     
  5. macrumors 68000

    savar

    Joined:
    Jun 6, 2003
    Location:
    District of Columbia
    #5
    It is possible to flip the coordinate system.

    I suggest you post your code.
     

Share This Page