bugGNUstep - Bugs: bug #26080, NSPopUpButton loaded from nib...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26080: NSPopUpButton loaded from nib doesn't send action message

Submitted by:  Doug Simons <theeggcamefirst>
Submitted on:  Fri 03 Apr 2009 08:02:55 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Mon 15 Jun 2009 05:35:45 PM UTC, comment #5:

The code has been added to GNUstep gui

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Fri 10 Apr 2009 06:28:19 AM UTC, comment #4:

Oops! There is a small mistake in that code. It seems that the sender of the action message should actually be the popup button, not the menu item in this case, so the code should read:
[NSApp sendAction:[self action] to:[self target] from:self];

Doug Simons <theeggcamefirst>
Thu 09 Apr 2009 11:22:22 PM UTC, comment #3:

For now I've implemented this as a category in my code, and it solves the problem. Here's the code:

@interface NSPopUpButtonCell (CocoaExtensions)
-(void) _popUpItemAction:(id)sender;
@end

@implementation NSPopUpButtonCell (CocoaExtensions)
-(void) _popUpItemAction:(id)sender
{
[NSApp sendAction:[self action] to:[self target] from:sender];
}
@end

Doug Simons <theeggcamefirst>
Thu 09 Apr 2009 09:14:20 PM UTC, comment #2:

It seems that the issue is that in Cocoa, items in NSPopUpButtons that aren't assigned a specific target/action are saved in a nib file with the action _popUpItemAction: and the NSPopUpButtonCell as the target. In GNUstep, the NSPopUpButtonCell class doesn't currently implement a _popUpItemAction: method.

If such a method could be added, which would send the popup button's action to the popup button's target, but with the menu item as the sender, I believe that would resolve the problem. Thanks!

Doug Simons <theeggcamefirst>
Fri 03 Apr 2009 08:56:24 PM UTC, comment #1:

Could you please provide a sample NIB file, plus minimal application, that demonstrates this behaviour?

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Fri 03 Apr 2009 08:02:55 PM UTC, original submission:

I've verified that the target and action are set correctly in an NSPopUpButton after it is loaded from a nib file, but changing the selection doesn't send the action message. I'm guessing that something isn't getting initialized properly between the button and its menu.

Doug Simons <theeggcamefirst>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by theeggcamefirst (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 15 Jun 2009 05:35:45 PM UTCFredKieferStatusNone=>Fixed
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1