message passing via NSViews w/o actual Cocoa calls

Ask a Question related to Mac Programming, Design and Development.

  1. #1

    Default message passing via NSViews w/o actual Cocoa calls

    Hi, I'm fairly new to Cocoa programming; have been doing a few of the
    tutorials in Hillegass' book. I've spent some time with OGL though,
    so right now I'm trying to do a simple port of an app written a while
    back in glut using glui as a simple GUI interface. This question may
    have more to do with simple objective-c than with cocoa, but here
    goes.

    Here's my situation:

    I've managed to get multiple windows with subclasses of NSOpenGLView
    up and running and rendering simple polygons. I also have simple
    message passing thanks to IB; i.e. clicking an NSButton shows or hides
    a polygon. My problem is, thanks to Interface Builder, I can't seem
    to access either of the actual NSOpenGLView-subclasses as pointers.
    What I would ultimately like to do is be able to pass some information
    from one NSOpenGLView subclass to the other one, without having to go
    through IBOutlets and IActions. Interface Builder seems to hide quite
    a bit of information; i.e. when one creates a window and puts an
    NSOpenGLView inside it, where exactly is the pointer to the
    NSOpenGLView?

    searches for keywords such as "objective-c message passing", etc.
    didn't quite turn up what I was looking for, so if anyone has
    pointers, comments, or hints I would be much appreciative.

    thanks,
    matt
    matt Guest

  2. Similar Questions and Discussions

    1. Getting the actual message being transmitted
      I am calling a webmethod using a proxy class generated using WSDL. Is it possible to get the actuall request message that is being submitted during...
    2. Check the actual FPS and use it as a variable
      Hello, Just saw your post about getting the actual FPS in a variable, was wondering if you got the solution. Thanks a lot.
    3. Parsing the client URL rather than the actual URL
      Greetings, I've been reading up on Search Engine optimisation, and I've come across a little gem which makes me realise my pages are probably all...
    4. actual publishing
      I have Publisher 2000. I used the tutorials, which were very helpful. I even did the Nav Bar Wizard. I guess I don't understand how this is...
    5. Async Message Passing Mechanism Wanted
      Is there a Perl module that implements a low-overhead FIFO (order-preserving) async message passing mechanism and works on Windows and Unix? It...
  3. #2

    Default Re: message passing via NSViews w/o actual Cocoa calls

    matt <matthew.romaine@jp.sony.com> wrote:
    > Hi, I'm fairly new to Cocoa programming; have been doing a few of the
    > tutorials in Hillegass' book. I've spent some time with OGL though,
    > so right now I'm trying to do a simple port of an app written a while
    > back in glut using glui as a simple GUI interface. This question may
    > have more to do with simple objective-c than with cocoa, but here
    > goes.
    >
    > Here's my situation:
    >
    > I've managed to get multiple windows with subclasses of NSOpenGLView
    > up and running and rendering simple polygons. I also have simple
    > message passing thanks to IB; i.e. clicking an NSButton shows or hides
    > a polygon. My problem is, thanks to Interface Builder, I can't seem
    > to access either of the actual NSOpenGLView-subclasses as pointers.
    > What I would ultimately like to do is be able to pass some information
    > from one NSOpenGLView subclass to the other one, without having to go
    > through IBOutlets and IActions. Interface Builder seems to hide quite
    > a bit of information; i.e. when one creates a window and puts an
    > NSOpenGLView inside it, where exactly is the pointer to the
    > NSOpenGLView?
    >
    > searches for keywords such as "objective-c message passing", etc.
    > didn't quite turn up what I was looking for, so if anyone has
    > pointers, comments, or hints I would be much appreciative.
    What you're trying to do is no different from trying to get a reference
    to any other view on a window. Your button likely has an IBOutlet to
    your NSOpenGLView. That's the pointer you're looking for (actually an
    id, not a pointer, but the distinction isn't important in this context).
    You can set up your controller class (or whatever other class needs it;
    maybe the other gl views, maybe the window, and so on) with similar
    IBOutlets and then just play snap-together in IB.
    Paul Mitchum Guest

  4. #3

    Default Re: message passing via NSViews w/o actual Cocoa calls

    In <fa39fc69.0308122318.1f3bc5ca@posting.google.com > matt wrote:
    > when one creates a window and puts an
    > NSOpenGLView inside it, where exactly is the pointer to the
    > NSOpenGLView
    There are no "pointers" to anything inside IB. If you create an outlet
    in one instance and connect it to something else, that will be a
    "pointer". What's there is what you put there. m.

    --
    matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
    REALbasic: The Definitive Guide! 2nd edition!
    [url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
    Subscribe to TidBITS. It's free and smart.
    matt neuburg Guest

  5. #4

    Default Re: message passing via NSViews w/o actual Cocoa calls

    [email]usenet@mile23.com[/email] (Paul Mitchum) wrote in message news:<1fzluvb.egrnvn14v03pcN%usenet@mile23.com>...
    > What you're trying to do is no different from trying to get a reference
    > to any other view on a window. Your button likely has an IBOutlet to
    > your NSOpenGLView. That's the pointer you're looking for (actually an
    > id, not a pointer, but the distinction isn't important in this context).
    > You can set up your controller class (or whatever other class needs it;
    > maybe the other gl views, maybe the window, and so on) with similar
    > IBOutlets and then just play snap-together in IB.
    Paul, thanks. In the examples that I've done, IBOutlets have been
    attached to NSObjects, such as:

    IBOutlet NSButton *button;
    IBOutlet NSBox *box;

    but in my case, I just want one function in an NSOpenGLView to
    immediately call another one in a different NSOpenGLView; so is it
    legit to do:

    IBOutlet void function_that_calls_IAction_in_other_NSOpenGLVIew;

    ?

    Just want to confirm before I head down this path.

    thanks again,
    matt
    matt Guest

Posting Permissions

  • You may not post new threads
  • You may 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