• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: save menu/icon mysteriously disabled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: save menu/icon mysteriously disabled


  • Subject: Re: save menu/icon mysteriously disabled
  • From: Matt Neuburg <email@hidden>
  • Date: Sun, 20 Mar 2005 07:31:11 -0800

On Sun, 20 Mar 2005 10:03:34 -0500, Matthew Weinstein <email@hidden>
said:

>I want to save documents programmatically. To do so I use the pair:
>
>     [mydoc writeToFile: projName ofType: fileType];
>     [mydoc setFileName: projName];
>
>This does create a file at projName, but it leaves the save menu item
>disabled. If I dirty my NSTextView and the dirty flag (close button) is
>lit, it still doesn't let me save. If I click the close button it gives
>me a save dialogue (even though I've set the name).

You want to save a document; the Cocoa way to do this is to use the document
architecture. If you absolutely refuse to do that, then taking command of
the Save menu's enablement is up to you; it will never be enabled in a
non-document architecture app unless you take charge of it, since it has no
target/action connection.

So you want to read the manual either on the document architecture or on how
menus get enabled (or both).

<.../Cocoa/Conceptual/Documents/index.html>
<.../Cocoa/Conceptual/MenuList/Tasks/EnablingMenuItems.html>

 m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: setuid helper tool
  • Next by Date: Re: Faking large arrays in bindings to satisfy sparse data...
  • Previous by thread: save menu/icon mysteriously disabled
  • Next by thread: Getting an image path from NSImageView
  • Index(es):
    • Date
    • Thread