discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issue with auto-enable of Menus


From: Ivan Vučica
Subject: Re: issue with auto-enable of Menus
Date: Mon, 13 Nov 2017 11:54:04 +0000

To add to thread from a different perspective...

Menu items should auto enable/disable depending on whether the target object supports the passed selector.

Would it make sense to not have custom code to enable/disable menu items, and just have appkit do it for you depending on the target?

This works especially magically if you use target NSFirstResponder and target the “first responder” correctly. Depending on how Graphos works, this might be infeasible, of course.

ned, 12. stu 2017. u 20:17 Riccardo Mottola <riccardo.mottola@libero.it> napisao je:
Hi,

I enhanced Graphos to enable/disable automatically menus dependent on
the selection of objects.
E.g. the idea is that you can edit something only if an object is
selected.

I detect the menu depending on the connected action.

The code works for certain custom actions, but not for cut/copy/delete

This works fine on Mac, but not on GNUstep!
I wonder why?

   if (action == @selector(copy:) || action == @selector(cut:) ||
action == @selector(delete:))
     {
       if (selectedObjs)
         return YES;
       else
         return NO;
     }

the relevant code is in GRDocView.m

http://svn.savannah.gnu.org/viewvc/gap/trunk/user-apps/Graphos/GRDocView.m?revision=3565&view=markup

Riccardo

--
Proudly sent with GNUMail !


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
--
Sent from Gmail Mobile on iPad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]