Getting NSDocument to load a file into current window

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

  1. #1

    Default Getting NSDocument to load a file into current window

    Hi!, I am new to Cocoa, and was hopeing someone could help me with a little problem I was
    having. I am writing a simple hex editor, and would like to be able to drag any file into
    my NSDocument subclass, and have that document displayed in hex format.
    However whenever, I drag a document Into the window, or even just use the Open menu item,
    a NEW NSDocument opens up, with the file displayed. I would like to be able to display the
    file in the current window. What is the best Cocoa approved methode of doing this?

    Currently I am useing loadDataRepresentation:(NSDAta *)data ofType:(NSString *)aType
    to get the behavior I don't want.

    Thanks for any assistance you can give.

    -Eric
    Eric Lada Guest

  2. Similar Questions and Discussions

    1. Page_Load not fired when window.open used to load window.
      Hello John, Did you mean that the problem only happens after you upgrade to VS 2003 and framework 1.1? Does the problem exist in VS 2002 and...
    2. load php or html file into flash pop up window ?
      Hi, Is it possible to load a web page or PHP file into a pop up window, movieclip or dynamic text box ? I have tried all 3 but cannot get it to...
    3. play 'outro' of current MC then load next MC on button
      Hi I need a little help with this please: On the root of my movie I have a empty container MC called 'container'. I have a number of MC's that...
    4. Customize current browser window
      Hello, I would like to know if it's possible to customize the current browser window. I know it's possible to open a new window without the...
    5. load a .swf file within current .swf as per value of external text file
      Hi ! I am confused at a point and need help. I just want to load a .swf file within my current .swf file as per the value the external text...
  3. #2

    Default Re: Getting NSDocument to load a file into current window

    In <slrnblqn99.2ta.ericlada@eric-ladas-computer.local> Eric Lada wrote:
    > Hi!, I am new to Cocoa, and was hopeing someone could help me with a
    > little problem I was having. I am writing a simple hex editor, and
    > would like to be able to drag any file into my NSDocument subclass,
    > and have that document displayed in hex format. However whenever,
    > I drag a document Into the window, or even just use the Open menu item,
    > a NEW NSDocument opens up, with the file displayed. I would like to
    > be able to display the file in the current window. What is the best
    > Cocoa approved methode of doing this?
    Open means open a new document. If that isn't the behavior you want - e.
    g. you just want a single window at all times - then you aren't using a
    document-oriented paradigm, and you should not be using a document-based
    application as the basis of your project. 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

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