objective c - How to make a keyboard Shortcut <Command + S> to save from multiple windows -
ok, having project having many xib's , each xib contains many nswindows.
i need use keyboard shortcut save each of window.
do need create muliple mainmenu nsmenuitems each of xib. problem there how single cmd+s know window in focus , how method invoked.
no need not make multiple nsmenuitems.
the 1 coming mainmenu.xib serves purpose.
make ibaction of file->save
menu , use :
- (ibaction)savemenu:(id)sender { nswindow *currentwindow=[nsapp keywindow]; nslog(@"this key window : %@", currentwindow.title); }
this give active window.
in each of controllers, need override
- (void)savedocument:(id)sender;
and bind using ib.
Comments
Post a Comment