From 98de1f5f512be15d4e56fcb4ce2b9900bc0ed1ae Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 13 Aug 2012 20:34:23 +0200 Subject: [PATCH] Select popup menu item only on non-negative index. --- Frameworks/OakAppKit/src/NSView Additions.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Frameworks/OakAppKit/src/NSView Additions.mm b/Frameworks/OakAppKit/src/NSView Additions.mm index a9d965f0..20841c04 100644 --- a/Frameworks/OakAppKit/src/NSView Additions.mm +++ b/Frameworks/OakAppKit/src/NSView Additions.mm @@ -10,7 +10,8 @@ [cell setFont:font]; [cell setAltersStateOfSelectedItem:NO]; [cell setMenu:menu]; - [cell selectItemAtIndex:index]; + if(index >= 0) + [cell selectItemAtIndex:index]; [cell performClickWithFrame:rect inView:self]; } @end