Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NSWindow and keyboard shortcuts

18 views
Skip to first unread message

LPT

unread,
Nov 15, 2009, 11:27:51 AM11/15/09
to
M app is an NSSTatusItem. I'm using an NSWindow as its About Box. When
the AB is displayed, I can close it by clicking on the red button in the
upper left corner, but it does not respond to a cmd-w shortcut. This
seems like pretty fundamental behavior, but I can't figure out how to
implement it. Can someone give me a hand?
Thanks

Luddite Wacko

unread,
Nov 29, 2009, 3:44:12 PM11/29/09
to
Quick and dirty solution IB: put a button in the window, perhaps outside
its content view's bounds, set the button to respond to cmd-W, and set
it connect its action to the window's close method. In the absence of a
predictable menubar, this is the easy, code-free way of getting what you
want.

LPT

unread,
Dec 27, 2009, 11:07:16 AM12/27/09
to
In article <20091129124...@news.mw.centurytel.net>,
Luddite Wacko <sy...@undernet.org> wrote:

Thanks. but I ended up just subclassing NSWindow and overridding
performKeyEquivalent.

0 new messages