bug-gnustep
[Top][All Lists]
Advanced

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

Re: Menu system patches


From: Alexander Malmberg
Subject: Re: Menu system patches
Date: Sat, 22 Feb 2003 12:46:27 +0100

Serg Stoyan wrote:
> 
> Hi,
> 
> The following patch correct some menu system related issues:
[snip]
> - right click on NSPopUpButton doesn't produce app menu inside
>   NSPopUpButton's (reported by Stefan Urbanek in "NSPopupButton displays
>   black menu titlebar" mail)

The patch for this is incorrect. Always bringing up the main menu on
right clicks breaks event handling (windows and views never see the
right clicks and can't handle them first). It also hides the real
problem behind this.

NSView has a system for context-specific menus for views. This is
implemented in NSWindow; it works by calling [NSView -menuForEvent:]
and, if it returns a menu, displaying it instead of sending the event to
the view. [NSView -menuForEvent:] by defaults calls [NSView -menu],
which calls [isa +defaultMenu], which by default returns nil. However,
it seems that mosx added [NSPopUpButton -menu], which returns the pop-up
menu, so NSWindow thinks that it's a context menu and displays it (or
tries; obviously, something goes wrong there, but I haven't looked
closely at that).

Anyway, I've committed a fix (implement -menuForEvent: in NSPopUpButton
to always return nil) and changed NSApplication back to the old
behavior.

- Alexander Malmberg




reply via email to

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