Allow openPanel to choose folders in Cocoa document-based application?

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

  1. #1

    Default 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
    situations the document model I use can be constructed from the contents
    of a Folder, and I would like to allow users to select a folder.
    Validation of the contents (to see if they in fact form a document)
    would be done in an NSDocument subclass method.

    I realize I could subclass NSDocumentController, and implement my own
    version of openDocument, but am wondering if this is the best way (seems
    a lot to subclass a major class just to override one GUI default).

    Thanks for any suggestions,

    ER
    Eric Raas Guest

  2. Similar Questions and Discussions

    1. Accessing files/folders inside other application folders
      How can I have an asc file from one application read text files in another applications directory? I have multiple applications creating text...
    2. 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...
    3. beginner question 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...
    4. OT: (Web-based) Document Management Systems
      ** Apologies for the cross-posting; I thought it better than multi-posting 3 differing msgs to 3 NGs. We're introducing a new project management...
    5. multiple document and window types in cocoa
      In <210720030631331455%none@none.com> None wrote: Use the existing document framework. Let the AppKit do the work. You don't need to store...
  3. #2

    Default Re: Allow openPanel to choose folders in Cocoa document-based application?

    Eric Raas <foo@bar.net> wrote in message news:<20030918141918883-0400@nntp.mgh.harvard.edu>...
    > 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
    > situations the document model I use can be constructed from the contents
    > of a Folder, and I would like to allow users to select a folder.
    > Validation of the contents (to see if they in fact form a document)
    > would be done in an NSDocument subclass method.
    [openPanel setCanChooseDirectories:YES];

    assuming that openPanel is your openPanel.
    Eric Pepke Guest

  4. #3

    Default Re: Allow openPanel to choose folders in Cocoa document-basedapplication?

    In <ef37f531.0309201842.1de8450@posting.google.com> Eric Pepke wrote:
    > Eric Raas <foo@bar.net> wrote in message news:<20030918141918883-0400@
    > nntp.mgh.harvard.edu>...
    >> 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 situations the document model I use can be constructed from the
    >> contents of a Folder, and I would like to allow users to select a
    >> folder. Validation of the contents (to see if they in fact form a
    >> document) would be done in an NSDocument subclass method.
    >
    > [openPanel setCanChooseDirectories:YES];
    >
    > assuming that openPanel is your openPanel.
    >
    Thanks - I have used setCanChooseDirectories:YES in the past when I have
    launched an openPanel outside of the Cocoa document framework. What I
    am wondering is where this operation should go in a Document-based app (
    in an NSDocument method? in an override of NSDocumentController?)

    ER
    Eric Raas Guest

  5. #4

    Default Re: Allow openPanel to choose folders in Cocoa document-based application?

    Eric Raas <foo@bar.net> wrote in message news:<20030921104429426-0400@news.verizon.net>...
    > Thanks - I have used setCanChooseDirectories:YES in the past when I have
    > launched an openPanel outside of the Cocoa document framework. What I
    > am wondering is where this operation should go in a Document-based app (
    > in an NSDocument method? in an override of NSDocumentController?)
    TIMTOWTDI, but I put it in a custom subclass NSDocumentController,
    which I just put in the main nib file. The system seems magically
    to know to use that one.
    Eric Pepke Guest

  6. #5

    Default Re: Allow openPanel to choose folders in Cocoa document-based application?

    In article <ef37f531.0309221906.7f987624@posting.google.com >,
    [email]epepke@acm.org[/email] (Eric Pepke) wrote:
    > Eric Raas <foo@bar.net> wrote in message
    > news:<20030921104429426-0400@news.verizon.net>...
    > > Thanks - I have used setCanChooseDirectories:YES in the past when I have
    > > launched an openPanel outside of the Cocoa document framework. What I
    > > am wondering is where this operation should go in a Document-based app (
    > > in an NSDocument method? in an override of NSDocumentController?)
    >
    > TIMTOWTDI, but I put it in a custom subclass NSDocumentController,
    > which I just put in the main nib file. The system seems magically
    > to know to use that one.
    What does "TIMTOWTDI" mean? I've seen a lot of this kind of
    abbreviation, but this one's new on me.

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See [url]http://www.atomicbird.com/[/url]
    Tom Harrington Guest

  7. #6

    Default Re: Allow openPanel to choose folders in Cocoa document-based application?

    Tom Harrington <tph@pcisys.no.spam.dammit.net> wrote:
    > What does "TIMTOWTDI" mean? I've seen a lot of this kind of
    > abbreviation, but this one's new on me
    You could easily learn what this abbreviation means just by typing it
    into Google. Not that you'd have to use Google particularly; there is
    more than one way to do it, I'm certain. Heck, just reading this note
    carefully might tell you the answer. One way or another, though, wasting
    bandwidth here is just utterly needless. m.

    --
    matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt/[/url]
    Read TidBITS! It's free and smart. [url]http://www.tidbits.com[/url]
    matt neuburg 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