[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in NSMenu
From: |
Benhur Stein |
Subject: |
bug in NSMenu |
Date: |
Sun, 23 Sep 2001 19:38:22 +0200 |
Hi all!
While loading a gmodel that contains a menu using gnustep's snapshot
of friday, the program dies with an exception (invalid index) inside
[NSMenuView itemChanged].
The problem seems to be that NSMenuView is getting a notification that
an item has been changed before getting the notification that the same
item has been inserted.
[NSMenu insertItem:atIndex:] calls [NSMenuItem setMenu:] and only after that
it sends NSMenuDidAddItemNotification.
The problem is that [NSMenuItem setMenu:] calls [NSMenu itemChanged:],
which sends NSMenuDidChangeItemNotification.
Sorry, didn't have time to try correcting the code.
The backtrace just before the exception:
#0 _i_NSMenuView__itemChanged_ (self=0x82067f8, _cmd=0x4028cac0,
notification=0x8243f18) at NSMenuView.m:267
#1 0x403cb8ae in _i_NSNotificationCenter__postNotification_ (self=0x80bc500,
_cmd=0x4028b2b0, notification=0x8243f18) at NSNotificationCenter.m:1080
#2 0x4013c1c8 in _i_NSMenu__itemChanged_ (self=0x81fe458, _cmd=0x4028e150,
anObject=0x820a998) at NSMenu.m:360
#3 0x40145e44 in _i_NSMenuItem__setTarget_ (self=0x820a998, _cmd=0x4028df78,
anObject=0x81fe458) at NSMenuItem.m:365
#4 0x40144e4e in _i_NSMenuItem__setMenu_ (self=0x820a998, _cmd=0x4028b1c0,
menu=0x81fe458) at NSMenuItem.m:143
#5 0x4013bac6 in _i_NSMenu__insertItem_atIndex_ (self=0x81fe458,
_cmd=0x4028b220, newItem=0x820a998, index=0) at NSMenu.m:250
#6 0x4013bd64 in _i_NSMenu__addItem_ (self=0x81fe458, _cmd=0x409f42d8,
newItem=0x820a998) at NSMenu.m:289
Benhur
- bug in NSMenu,
Benhur Stein <=