discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Adding NSMenuItems/view to a window


From: Ivan Vučica
Subject: Re: Adding NSMenuItems/view to a window
Date: Tue, 31 Mar 2015 16:40:10 +0100

Even if it is possible, I would strongly discourage doing it. What possible reason could you have for doing it? 

I could be wrong (I spent about 3 min total looking into this), but this line in NSMenu, saying "// Create a NSMenuView to draw our menu items.", makes me think this might not be possible.
  https://github.com/gnustep/gui/blob/d8f2950729b7b10a2343/Source/NSMenu.m#L673

Considering NSMenuView contains code handling -mouseDown: et al, I'd suspect that to be the reason your approach doesn't work.

I strongly suggest you to implement this in a different way, e.g. by subclassing NSButton.

On Sun, Mar 29, 2015 at 3:23 PM, Luis Garcia Alanis <luis@garcia.tv> wrote:
Hello,

I am having some trouble with an experiment I am performing.

I am trying to add 3 NSMenuItems to a custom view.

I create the NSMenuItem's and use the view method to extract the view and add it as a sub view of an NSView but nothing seems to happen, nothing gets displayed.

Is this even possible?

I wan to be able to click on these menu items and also to have the mouse hover effect when the mouse is on top of the items.

This is not a context menu, but rather a regular window containing the NSMenuItems.

Thanks
Luis

_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep



reply via email to

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