beep on click when no items to display

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16454 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sergii Stoian 2003-04-13 08:56:35 +00:00
parent 9ad516dd0a
commit 69fc3b2540

View file

@ -338,6 +338,12 @@ this to return nil to indicate that we have no context menu.
if ([self isEnabled] == NO)
return;
if ([[_cell menu] numberOfItems] == 0)
{
NSBeep ();
return;
}
// Attach the popUp
[_cell attachPopUpWithFrame: _bounds
inView: self];
@ -422,6 +428,13 @@ this to return nil to indicate that we have no context menu.
NSMenuView *menuView;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
// Beep, as on OS, and then return.
if ([[_cell menu] numberOfItems] == 0)
{
NSBeep();
return;
}
menuView = [[_cell menu] menuRepresentation];
if ([[menuView window] isVisible] == NO)
{