Fix issues with active document and menu dismissal when testing

This commit is contained in:
Gregory John Casamento 2023-06-23 10:21:51 -04:00
parent b8dc15cca3
commit 248d81bf74
5 changed files with 17 additions and 6 deletions

View file

@ -14,10 +14,6 @@
"loadImage:",
"loadPallete:",
"loadSound:",
"newAction11:",
"newAction12:",
"newAction13:",
"newAction14:",
"ungroup:",
"orderFrontFontPanel:",
"palettes:",

View file

@ -453,7 +453,8 @@
NSString *subClassName;
id obj;
id savedDelegate = [NSApp delegate];
NSMenu *modelMenu = [activeDoc objectForName: @"NSMenu"];
// which windows were open when testing started...
testingWindows = [[NSMutableArray alloc] init];
en = [[NSApp windows] objectEnumerator];
@ -581,6 +582,8 @@
}
}
[modelMenu close];
// so we don't get the warning...
[NSApp setServicesMenu: nil];
[[NSApp mainMenu] display];

View file

@ -504,6 +504,7 @@ static NSImage *fileImage = nil;
object: aConnector];
[connections addObject: aConnector];
[self touch]; // make sure the doc is marked as modified...
[nc postNotificationName: IBDidAddConnectorNotification
object: aConnector];

View file

@ -112,7 +112,18 @@ static NSNotificationCenter *nc = nil;
- (void) touch: (id)sender
{
id<IBDocuments> doc = [(id<IB>)NSApp activeDocument];
id delegate = [NSApp delegate];
id<IBDocuments> doc = nil;
if ([NSApp respondsToSelector: @selector(activeDocument)])
{
doc = [(id<IB>)NSApp activeDocument];
}
else if ([delegate respondsToSelector: @selector(activeDocument)])
{
doc = [delegate activeDocument];
}
[doc touch];
}