beginner question document based application

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

  1. #1

    Default beginner question re: document based application

    I've got a document based Cocoa application, and I would like to have
    a single NSPanel which shows certain stuff about the current document.
    I think that I want to create a conroller which has a class method
    creating or returning a one and only instance of the panel's
    controller which I can then inform of what the current document is.
    But -- how I know when the current document changes?
    Paul Forgey Guest

  2. Similar Questions and Discussions

    1. Beginner question
      new to the world of asp! I'm trying to define session variables using the following code: Session("Employee")= when i replace the Session...
    2. FMS Beginner Question
      I'm a total newbie here so I appreciate any help. We just installed FMS and would like to use it for streaming videos. I've researched and found...
    3. web-based application question
      Hi, I have a perl script that I would like to make available on-line. I suspect the target community (microbiologists) has no interest in...
    4. PHP beginner question
      Hello, I am currently learning PHP, and I have a problem with some variables. On the first page (choix.php), there is a form that lists product...
    5. Allow openPanel to choose folders in Cocoa document-based application?
      I am trying to figure out the best way to force the open panel of a Cocoa document-based application to allow selection of folders. In some...
  3. #2

    Default Re: beginner question re: document based application

    In <207eddbd.0309121718.348e75d5@posting.google.com > Paul Forgey wrote:
    > I've got a document based Cocoa application, and I would like to have
    > a single NSPanel which shows certain stuff about the current document.
    > I think that I want to create a conroller which has a class method
    > creating or returning a one and only instance of the panel's
    > controller which I can then inform of what the current document is.
    > But -- how I know when the current document changes?
    Use a notification. Look at the notifications for a window. From a
    window you can get its windowcontroller and document. 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

  4. #3

    Default Re: beginner question re: document based application

    matt neuburg <matt@tidbits.com> wrote in message news:<20030913092526765-0700@news.la.sbcglobal.net>...
    > In <207eddbd.0309121718.348e75d5@posting.google.com > Paul Forgey wrote:
    > > I've got a document based Cocoa application, and I would like to have
    > > a single NSPanel which shows certain stuff about the current document.
    > > I think that I want to create a conroller which has a class method
    > > creating or returning a one and only instance of the panel's
    > > controller which I can then inform of what the current document is.
    > > But -- how I know when the current document changes?
    >
    > Use a notification. Look at the notifications for a window. From a
    > window you can get its windowcontroller and document. m.
    Forgot about that, thanks! Since I subclassed NSWindowController for
    my document window, this was very easy to do. Just made my controller
    delegate for the document window (rather than notifications, which I
    guess I would do if I didn't subclass NSWindowController), and used
    windowWillClose: and windowDidBecomeMain:. For the shared panel
    controller then, I gave it methods document: and setDocument:. When
    the document window becomes main, I call setDocument: on the panel,
    and when the window closes, I call setDocument:nil ONLY if document:
    returns my current document.
    Paul Forgey 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