From 69fc3b25405ebe0d8a3a7a65ac27d247a8cc5510 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Sun, 13 Apr 2003 08:56:35 +0000 Subject: [PATCH] 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 --- Source/NSPopUpButton.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index f66cbebb5..f82ffb03b 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -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) {