Professional Web Applications Themes

Which class do I need ? - Mac Programming

As a newbie mac programmer (but longtime C/Posix programmer) I've been teaching myself Cocoa programming on Mac OS X via the Hillegass book and the apple doentation. I think I'm fairly well grounded now, without aid, I've created small apps which do what I think they should do, I've become used to Xcode and the Interface Builder. What I'm confused about is, I would like my next application to have a drawing area in the window. This area should resize with the window (I can do this in IB) and I should be able to ask it how big it ...

  1. #1

    Default Which class do I need ?

    As a newbie mac programmer (but longtime C/Posix programmer) I've been
    teaching myself Cocoa programming on Mac OS X via the Hillegass book and
    the apple doentation.

    I think I'm fairly well grounded now, without aid, I've created small
    apps which do what I think they should do, I've become used to Xcode and
    the Interface Builder.

    What I'm confused about is, I would like my next application to have a
    drawing area in the window. This area should resize with the window (I
    can do this in IB) and I should be able to ask it how big it is.

    I need to know if there's a mouse click in the area, and what
    co-ordinates that was at, and I'd like to be able to draw pixels, boxes,
    fill areas etc. in the area in response to the mouse clicks.

    The problem is, I'm unsure about which cocoa object to put in the window
    to allow this. There dosen't seem to me to be anything suitable. I think
    in Java a few years ago when I dabbled, I think I would have used a canvas.

    Any help appreciated!

    Cheers


    --
    Remove stars for email
    g*a*r*y**k*l*i*n*g*o*n*.*o*r*g*.*u*k*
    Gary Guest

  2. #2

    Default Re: Which class do I need ?

    In article <uk.clara.net>,
    Gary <0.0.1> wrote:
     

    Your own subclass of NSView. Look at Chapter 14, presuming you're using
    the 2nd edition of Hillegass.

    G

    --
    Standard output is like your butt. Everyone has one. When using a bathroom,
    they all default to going into a toilet. However, a person can redirect his
    "standard output" to somewhere else, if he so chooses. - Jeremy Nixon
    Gregory Guest

  3. #3

    Default Re: Which class do I need ?

    "Gregory Weston" <com> wrote in message
    news:comcast.net... [/ref]
    canvas. 

    I only have 10.1.5, but it included an example "DotView" which demonstrates
    exactly what you want.

    Tom.


    Tom Guest

  4. #4

    Default Re: Which class do I need ?

    Gregory Weston wrote:

     


    Hm. I have a little bookmark sticking out of the book in ch.14 so it
    caught my eye. Didn't immediatley leap out as the solution though. I
    will re-read. Thanks.

    --
    Remove stars for email
    g*a*r*y**k*l*i*n*g*o*n*.*o*r*g*.*u*k*
    Gary Guest

Similar Threads

  1. Replies: 0
    Last Post: September 20th, 10:15 PM
  2. #25580 [Opn]: set_error_handler to a class/method resets class properties when error occurs
    By paul dot liversidge at recycledpixels dot com in forum PHP Development
    Replies: 0
    Last Post: September 17th, 08:07 PM
  3. #25580 [NEW]: set_error_handler to a class/method resets class properties when error occurs
    By paul dot liversidge at recycledpixels dot com in forum PHP Development
    Replies: 0
    Last Post: September 17th, 07:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139