• 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
Hanging on validateMenuItem when a document is minimized
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: main loop and idle function
  • Next by Date: Re: Programming NSImageView
  • Previous by thread: Re: Overriding NSTextField problem
  • Next by thread: CoreAudio and Cocoa
  • Index(es):
    • Date
    • Thread