views:

62

answers:

1

I am creating a Cocoa Application for Mac OS 10.6 >, and I want to hide the toolbar of an NSWindow automatically when it is not in use for at least 30 seconds. I think this can be done with NSTimers, but I'm not familiar with them and I don't know how I can implement this.

Another problem is that both the NSToolbarDelegate and NSWindowDelegate protocols don't have delegate methods like toolbarDidShow:

Can anyone point me in the right direction? Thanks.


PS. This is not to punish the user, but rather give the user a cleaner window (the window consist of only a toolbar for color and font and a text-view).


PPS. Can the hide-toolbar-animation lead into a problem with the cursor while the user is typing?

A: 

I think this can be done with NSTimers, but I'm not familiar with them and I don't know how I can implement this.

The Timer Programming Guide might help you here. It's easy enough to show and hide the toolbar, use -setVisible:. Also, -isVisible can be used to determine the visibility of the toolbar.

JeremyP