Hanging on validateMenuItem when a document is minimized
Hanging on validateMenuItem when a document is minimized
- Subject: Hanging on validateMenuItem when a document is minimized
- From: Jake MacMullin <email@hidden>
- Date: Sun, 24 Feb 2002 21:52:38 +1030
I have a cocoa document-based application that hangs (doesn't respond)
when all its documents are minimized. I think this has to do with the
fact that I have over-ridden the default validateMenuItem. Here is my
code:
public boolean validateMenuItem(NSMenuItem anItem) {
boolean enable = false;
if(anItem.title().equals("Compile")) {
// need to make sure there is at least one document open
if (this.documents().count()>0) {
if (this.currentDocument().isDocumentEdited()) {
enable = false;
} else {
enable = true;
}
} else {
enable = false;
}
} else if(anItem.title().equals("Run")) {
// need to make sure there is at least one document open
if (this.documents().count()>0) {
MyDocument myDocument =
(MyDocument)this.currentDocument();
if (myDocument.isCompiled) {
enable = true;
} else {
enable = false;
}
} else {
enable = false;
}
} else {
enable = true;
}
return (enable);
}
Why does this cause the application to stop responding when all the
windows are minimized? Does it have something to do with trying to see
if the minimized documents have been edited?
Thanks,
Jake MacMullin
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.