mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 15:31:56 +00:00
Recognize class that responds to menuRepresetation as NSMenu derived class. Fix for Gorm.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18383 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4d2177ce6d
commit
77d082747a
1 changed files with 17 additions and 11 deletions
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
|
#include <AppKit/NSPanel.h>
|
||||||
#include <AppKit/NSButton.h>
|
#include <AppKit/NSButton.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSMenu.h>
|
#include <AppKit/NSMenu.h>
|
||||||
|
@ -363,18 +364,10 @@
|
||||||
{
|
{
|
||||||
NSNotificationCenter *theCenter = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *theCenter = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
if ([owner class] == [NSMenu class])
|
if ([owner class] == [NSWindow class]
|
||||||
{
|
|| [owner class] == [NSPanel class])
|
||||||
_owner = owner;
|
|
||||||
_ownedByMenu = YES;
|
|
||||||
|
|
||||||
RELEASE (titleColor);
|
|
||||||
titleColor = RETAIN ([NSColor blackColor]);
|
|
||||||
[textAttributes setObject: [NSColor whiteColor]
|
|
||||||
forKey: NSForegroundColorAttributeName];
|
|
||||||
}
|
|
||||||
else if ([owner class] == [NSWindow class])
|
|
||||||
{
|
{
|
||||||
|
NSDebugLLog(@"GSTitleView: owner is NSWindow or NSPanel");
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
_ownedByMenu = NO;
|
_ownedByMenu = NO;
|
||||||
|
|
||||||
|
@ -396,8 +389,21 @@
|
||||||
name: NSWindowDidResignKeyNotification
|
name: NSWindowDidResignKeyNotification
|
||||||
object: _owner];
|
object: _owner];
|
||||||
}
|
}
|
||||||
|
else if ([owner respondsToSelector:@selector(menuRepresentation)])
|
||||||
|
{
|
||||||
|
NSDebugLLog(@"GSTitleView: owner is NSMenu");
|
||||||
|
_owner = owner;
|
||||||
|
_ownedByMenu = YES;
|
||||||
|
|
||||||
|
RELEASE (titleColor);
|
||||||
|
titleColor = RETAIN ([NSColor blackColor]);
|
||||||
|
[textAttributes setObject: [NSColor whiteColor]
|
||||||
|
forKey: NSForegroundColorAttributeName];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
NSDebugLLog(@"GSTitleView: %@ owner is not NSMenu or NSWindow or NSPanel",
|
||||||
|
[owner className]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue