mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
* Source/NSToolbarItem.m: Added _sendAction: method to send
the action with the NSToolbarItem instance as the sender when the toolbar item is represented by an NSMenuItem. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27573 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3bab225349
commit
d2ad402045
2 changed files with 21 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2009-01-10 15:49-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/NSToolbarItem.m: Added _sendAction: method to send
|
||||
the action with the NSToolbarItem instance as the sender
|
||||
when the toolbar item is represented by an NSMenuItem.
|
||||
|
||||
2009-01-09 23:09-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/NSMenu.m: Correction to previous change. Update when
|
||||
|
|
|
@ -1384,14 +1384,27 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
return _backView;
|
||||
}
|
||||
|
||||
//
|
||||
// This method invokes using the toolbar item as the sender.
|
||||
// When invoking from the menu, it shouldn't send the menuitem as the
|
||||
// sender since some applications check this and try to get additional
|
||||
// information about the toolbar item which this is coming from.
|
||||
//
|
||||
- (void) _sendAction: (id)sender
|
||||
{
|
||||
[NSApp sendAction: [self action]
|
||||
to: [self target]
|
||||
from: self];
|
||||
}
|
||||
|
||||
- (NSMenuItem *) _defaultMenuFormRepresentation
|
||||
{
|
||||
NSMenuItem *menuItem;
|
||||
|
||||
menuItem = [[NSMenuItem alloc] initWithTitle: [self label]
|
||||
action: [self action]
|
||||
action: @selector(_sendAction:)
|
||||
keyEquivalent: @""];
|
||||
[menuItem setTarget: [self target]];
|
||||
[menuItem setTarget: self];
|
||||
AUTORELEASE(menuItem);
|
||||
|
||||
return menuItem;
|
||||
|
|
Loading…
Reference in a new issue