From 94ea683223fc5e965cb15a826b33c1346e1c203b Mon Sep 17 00:00:00 2001 From: gcasa Date: Sat, 30 Jan 2010 03:11:56 +0000 Subject: [PATCH] * Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration for updateAllWindowsWithMenu: * Source/GSThemeMenu.m: Added default implementation of updateAllWindowsWithMenu: * Source/NSMenu.m: Added call to updateAllWindowsWithMenu: on current theme. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29445 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Headers/Additions/GNUstepGUI/GSTheme.h | 28 ++++++++++++++++++++++++++ Source/GSThemeMenu.m | 5 +++++ Source/NSMenu.m | 3 +++ 4 files changed, 45 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1ad838446..affd3fea1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-01-29 22:14-EST Gregory John Casamento + + * Headers/Additions/GNUstepGUI/GSTheme.h: Added new method + declaration for updateAllWindowsWithMenu: + * Source/GSThemeMenu.m: Added default implementation of + updateAllWindowsWithMenu: + * Source/NSMenu.m: Added call to updateAllWindowsWithMenu: on + current theme. + 2010-01-29 Eric Wasylishen * Source/NSTableHeaderCell.m: diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 6184c65ef..00b64b4b6 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -1015,11 +1015,39 @@ withRepeatedImage: (NSImage*)image @end @interface GSTheme (Menus) +/** + * This method sets the menu for the window using the current theme + * In the default theme this calls the setMenu: method on the window + * giving the menu parameter as the argument. + */ - (void) setMenu: (NSMenu *)menu forWindow: (NSWindow *)window; + +/** + * Processes menu events for the theme. The default implementation + * does nothing. + */ - (void) processCommand: (void *)context; + +/** + * Calculate the height of the menu for in-window menus. The default + * implementation returns [NSMenuView menuBarHeight]; + */ - (float) menuHeightForWindow: (NSWindow *)window; + +/** + * Update the menu for the window. This refreshes the menu contents. + * The default implementation of this method does nothing. + */ - (void) updateMenu: (NSMenu *)menu forWindow: (NSWindow *)window; +- (void) updateAllWindowsWithMenu: (NSMenu *) menu; @end +@interface GSTheme (OpenSavePanels) +/** + * This method displays and returns the open panel needed by the + * native environment. + */ +@end + #endif /* OS_API_VERSION */ #endif /* _GNUstep_H_GSTheme */ diff --git a/Source/GSThemeMenu.m b/Source/GSThemeMenu.m index eb853c039..314586fda 100644 --- a/Source/GSThemeMenu.m +++ b/Source/GSThemeMenu.m @@ -94,5 +94,10 @@ { // default implementation of this method does nothing. } + +- (void) updateAllWindowsWithMenu: (NSMenu *) menu +{ + // default implementation of this method does nothing. +} @end diff --git a/Source/NSMenu.m b/Source/NSMenu.m index efa3fd2b7..80f32c843 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -57,6 +57,7 @@ #include "AppKit/NSAttributedString.h" #include "GSGuiPrivate.h" +#include "GNUstepGUI/GSTheme.h" /* Drawing related: @@ -1064,6 +1065,8 @@ static BOOL menuBarVisible = YES; { [w setMenu: self]; } + + [[GSTheme theme] updateAllWindowsWithMenu: self]; } } if (_delegate)