On Feb 5, 2013, at 19:09:54, Lee Ann Rucker <lruc...@vmware.com> wrote:

> There's probably a KVO observer on isDocumentEdited; if nothing triggers 
> setDocumentEdited then it doesn't know to check it.
> 
> updateChangeCount: says
> 
> If you are implementing undo and redo in an application, you should increment 
> the change count every time you create an undo group and decrement the change 
> count when an undo or redo operation is performed.
> Note that if you are using the NSDocument default undo/redo features, setting 
> the document’s edited status by updating the change count happens 
> automatically. You only need to invoke this method when you are not using 
> these features.

Well, we've been calling [self updateChangeCount:NSChangeDone] all along. It 
seems that the window's close box only gets out of whack if we mark the doc 
dirty (via updateChangeCount) when the window is being drawn. There's a bug 
that causes the first draw to update some data members, which makes the doc 
dirty. In this case, we correctly call updateChangeCount:NSChangeDone. Even 
though we're doing that, the window's isDocumentEdited will still return false. 
So it's like updating that state during drawing is not allowing the window's 
isDocumentEdited state to change.

Since we do have that bug that causes non-dirty docs to become dirty during 
their first draw, I'm not going to worry about this too much. But it still 
seems to me like a Cocoa bug where the window state isn't getting changed when 
it should.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to