bugGNUstep - Bugs: bug #4815, [NSApp mainMenu] returns nil

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #4815: [NSApp mainMenu] returns nil

Submitted by:  None
Submitted on:  Mon 18 Aug 2003 04:29:41 AM UTC  
 
Category: GormSeverity: 1,5
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Gregory John Casamento <gcasa>
Open/Closed: Closed

Thu 04 Sep 2003 12:35:16 PM UTC, comment #5:

thanks, works for me.

Rob Burns <rburns>
Mon 01 Sep 2003 09:19:08 AM UTC, comment #4:

Tests indicate the mainMenu is initialized before awakeFromNib is called. I've made the necessary change to support this.

2003-09-01 09:23:34.278 loginpanel[30566] Decoding custom class GSTextView
2003-09-01 09:23:34.336 loginpanel[30566] LoginWindow class has been instantiated...
2003-09-01 09:23:34.359 loginpanel[30566] NSMenu: Main Menu (Normal)

It should now return the correct value. GJC

Gregory John Casamento <gcasa>
Project AdministratorIn charge of this item.
Mon 01 Sep 2003 06:55:44 AM UTC, comment #3:

NSLog(@"%@", [[NSApp mainMenu] description]);

will log (nil)

Is this because I am doing it in awakeFromNib? should it not work there? In other gorm files, none of the connections will be functional until after [self window] is called. (using an NSWindowController). Is this a similar problem? In this case it is awakeFromNib in the application delegate, and there is now windows in the gorm file.

Rob Burns <rburns>
Sun 31 Aug 2003 02:36:50 PM UTC, comment #2:

Program received signal SIGINT, Interrupt.
[Switching to Thread 1024 (LWP 24313)]
0x4068c5ab in poll () from /lib/i686/libc.so.6
(gdb) print [NSApp mainMenu]
$1 = 139441392
(gdb) print (char *)[[[NSApp mainMenu] description] cString]
$2 = 0x85f7390 "NSMenu: Gorm (Normal)\000"...
(gdb)

This is from the menu which is set in Gorm.

2003-08-31 14:39:41.544 loginpanel[26484] LoginWindow class has been instantiated...

Program received signal SIGINT, Interrupt.
[Switching to Thread 1024 (LWP 26484)]
0x406865ab in poll () from /lib/i686/libc.so.6
(gdb) Quit
(gdb) print (char *)[[[NSApp mainMenu] description] cString]
$1 = 0x83823f0 "NSMenu: Main Menu (Normal)\000"...
(gdb)

This is from another app I am working on. Both use .gorm files (obviously). ;)

/*
* See if there is a main menu to be set.
*/
menu = [nameTable objectForKey: @"NSMenu"];
if (menu != nil && [menu isKindOfClass: [NSMenu class]] == YES)
{
[NSApp setMainMenu: menu];
}

Above is the code in GSNibContainer which set this. I can't recreate this.

Gregory John Casamento <gcasa>
Project AdministratorIn charge of this item.
Mon 18 Aug 2003 04:48:42 AM UTC, comment #1:

Downgraded severity. Functionality currently works. This is likely an issue with Gorm not calling setMenu: when the NSApplication object is archived so that the menu is properly set.

This also might be an issue with NSApplication itself. I will investigate. If the latter is true it will be changed to an AppKit bug. Thanks. GJC

Gregory John Casamento <gcasa>
Project AdministratorIn charge of this item.
Mon 18 Aug 2003 04:29:41 AM UTC, original submission:

when using a gorm created menu, [NSApp mainMenu] will return nil. I've tried this with the 'menu' outlet in NSApplication connected and with it not, with the same results.

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 01 Sep 2003 09:19:08 AM UTCgcasaStatusInvalid=>(Error - Not Found)
Sun 31 Aug 2003 02:36:50 PM UTCgcasaOpen/ClosedOpen=>(Error - Not Found)
Sun 31 Aug 2003 02:36:49 PM UTCgcasaStatusNone=>(Error - Not Found)
Mon 18 Aug 2003 04:48:59 AM UTCgcasaAssigned toNone=>NA
Mon 18 Aug 2003 04:48:42 AM UTCgcasaSeverity3 - Normal=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1