• 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
Fwd: NSToolbar validation problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: NSToolbar validation problem


  • Subject: Fwd: NSToolbar validation problem
  • From: Nick Zitzmann <email@hidden>
  • Date: Sat, 8 Feb 2003 08:49:40 -0800

No one responded to my message on the macosx-dev mailing list, so maybe someone over here may be able to help...

Begin forwarded message:

From: Nick Zitzmann <email@hidden>
Date: Fri Feb 7, 2003 11:31:29 AM US/Pacific
To: email@hidden
Subject: NSToolbar validation problem

I'm having a weird problem with a document based application that uses toolbars in the controller and in the document.

My application has an NSWindow that is connected to the controller. The NSWindow has a toolbar in it, and the controller has a -validateToolbarItem: method in it so the toolbar items are validated. I also implemented a simple IBAction method that calls [window makeKeyAndOrderFront:sender] when called, and a menu item is set up in the main menu to point to that action.

But other than through that IBAction, the window may also be opened from a document method sending a message back to the controller that invokes another method that calls [window makeKeyAndOrderFront:]. The message is sent like [[controller defaultController] doSomething] where defaultController is a class method of controller.

Now, when the window is opened by the user selecting the menu item discussed above, the window comes to the front and becomes the key, the toolbar works fine, and the -validateToolbarItem: method is called regularly.

But if the document sends the message to the controller, as described above, the window comes to the front and becomes the key (but curiously it sometimes doesn't have a shadow), the toolbar works fine, but -validateToolbarItem: is never called at all in the controller.

If the user opens the window by selecting the menu item, then closes it, and later the document sends the message to the controller, -validateToolbarItem: stops getting called the moment it is opened the second time. If that's closed and the window is opened again from the menu item, then it still doesn't work.

In both cases, the same code is called to initialize the toolbar, but I really don't understand why this isn't working. I already checked and the document's -validateToolbarItem: method isn't being called to validate the controller's toolbar items.

Has anyone ever done anything like this before? What could I be missing here? TIA...

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://dreamless.home.attbi.com/

#include <stdsignature.h>
_______________________________________________
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: Object types (was: Pipes and helper tool)
  • Next by Date: Re: Localizable.strings inside framework bundles
  • Previous by thread: Re: Inverting an NSImage
  • Next by thread: Sheets, NSToolbar, and HIG
  • Index(es):
    • Date
    • Thread