From d985b2bc6b9983a82c00b25c162aec5545f9b23a Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 21 Oct 1999 14:19:45 +0000 Subject: [PATCH] Temporary fix: redisplay the button when the selected item is changed. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5045 72102866-910b-0410-8b05-ffd578937521 --- Source/NSPopUpButton.m | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 92278ab7e..d4b62a339 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -211,16 +211,22 @@ - (void)selectItemAtIndex:(int)index { - if (index == -1) + if (popb_selectedItem != index) { - popb_selectedItem = -1; + if (index == -1) + { + popb_selectedItem = -1; + } + else + { + popb_selectedItem = index; + } + // This works fine + [self setNeedsDisplay: YES]; + // but replace it with the following + // [self synchronizeTitleAndSelectedItem]; + // as soon as it works. } - else - { - popb_selectedItem = index; - } - - [self synchronizeTitleAndSelectedItem]; } - (void)selectItemWithTitle:(NSString *)title