Add menu to NSFontManager object using setFontMenu: in menus palette

This commit is contained in:
Gregory John Casamento 2021-05-15 02:04:15 -04:00
parent 028a22cd7b
commit 407a0403ad
2 changed files with 8 additions and 2 deletions

View file

@ -78,7 +78,8 @@
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
NSString *path = [bundle pathForImageResource: @"GormMenuDrag"];
NSImage *dragImage = [[NSImage alloc] initWithContentsOfFile: path];
NSFontManager *fm = nil;
originalWindow = [[NSWindow alloc] initWithContentRect:
NSMakeRect(0, 0, 272, 192)
styleMask: NSBorderlessWindowMask
@ -124,7 +125,10 @@
/*
* The Font menu
*/
m = [GormNSMenu menuWithMenu: [[NSFontManager sharedFontManager] fontMenu: YES]];
fm = [NSFontManager sharedFontManager];
m = [GormNSMenu menuWithMenu: [fm fontMenu: YES]];
[fm setFontMenu: m];
// Other font menu items
[m addItemWithTitle: @"Underline"
action: @selector(underline:)

View file

@ -124,6 +124,8 @@
forClassName: @"NSWindowTemplate"];
[u setClass: [GormNSWindow class]
forClassName: @"NSWindow"];
[u setClass: [IBUserDefinedRuntimeAttribute class]
forClassName: @"IBUserDefinedRuntimeAttribute5"];
//
// Substitute any classes specified by the palettes...