bugGNUstep - Bugs: bug #30025, NSMenu does not behave like on OS X

 
 

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

bug #30025: NSMenu does not behave like on OS X

Submitted by:  David Wetzel <dwetzel>
Submitted on:  Tue 01 Jun 2010 05:29:03 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Tue 10 Aug 2010 10:18:14 PM UTC, comment #5:

works for me now.
thanks Fred!

David Wetzel <dwetzel>
Project Member
Tue 10 Aug 2010 09:47:05 PM UTC, comment #4:

I added calls to synchronizeTitleAndSelectedItem in a few more places. This should fix the wrong behaviour you experienced.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 02 Aug 2010 05:44:20 PM UTC, comment #3:

synchronizeTitleAndSelectedItem is called MANY times on OSX...
(I pasted some here)

Breakpoint 2, 0x00007fff846bee8b in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] ()
(gdb) bt
#0 0x00007fff846bee8b in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] ()
#1 0x00007fff846d3540 in -[NSPopUpButtonCell setPullsDown:] ()
#2 0x00007fff846d2434 in -[NSPopUpButtonCell initTextCell:pullsDown:] ()
#3 0x00007fff84684db1 in -[NSControl initWithFrame:] ()
#4 0x00007fff84684cc2 in -[NSButton initWithFrame:] ()
#5 0x00007fff846d22ed in -[NSPopUpButton initWithFrame:pullsDown:] ()
#6 0x0000000100290a43 in -[GSMarkupTagView initPlatformObject:] (self=0x1003b4690, _cmd=0x1002961c8, platformObject=0x1003c91e0) at GSMarkupTagView.m:90
#7 0x0000000100289700 in -[GSMarkupTagControl initPlatformObject:] (self=0x1003b4690, _cmd=0x1002961c8, platformObject=0x1003c91e0) at GSMarkupTagControl.m:54
#8 0x000000010028d9c3 in -[GSMarkupTagPopUpButton initPlatformObject:] (self=0x1003b4690, _cmd=0x1002961c8, platformObject=0x1003c91e0) at GSMarkupTagPopUpButton.m:53
#9 0x0000000100284f6b in -[GSMarkupTagObject platformObject] (self=0x1003b4690, _cmd=0x1002961f8) at GSMarkupTagObject.m:189
#10 0x000000010028b1e3 in -[GSMarkupTagHbox initPlatformObject:] (self=0x1003b71f0, _cmd=0x1002961c8, platformObject=0x1003c7800) at GSMarkupTagHbox.m:76
#11 0x0000000100284f6b in -[GSMarkupTagObject platformObject] (self=0x1003b71f0, _cmd=0x1002961f8) at GSMarkupTagObject.m:189
#12 0x0000000100291934 in -[GSMarkupTagWindow initPlatformObject:] (self=0x1003b74a0, _cmd=0x1002961c8, platformObject=0x1003c7700) at GSMarkupTagWindow.m:109
#13 0x0000000100284f6b in -[GSMarkupTagObject platformObject] (self=0x1003b74a0, _cmd=0x1002961f8) at GSMarkupTagObject.m:189
#14 0x0000000100285e17 in +[NSBundle(GSMarkupBundleAdditions) loadGSMarkupData:withName:externalNameTable:withZone:localizableStringsTable:inBundle:tagMapping:] (self=0x7fff704555a8, _cmd=0x1002964c0, data=0x1003a7230, fileName=0x1003ac480, context=0x1003af420, zone=0x1002d9000, table=0x1003ac5b0, bundle=0x10032d9d0, mapping=0x0) at GSMarkupBundleAdditions.m:270
#15 0x0000000100285aed in +[NSBundle(GSMarkupBundleAdditions) loadGSMarkupData:withName:externalNameTable:withZone:localizableStringsTable:inBundle:] (self=0x7fff704555a8, _cmd=0x100296550, data=0x1003a7230, fileName=0x1003ac480, context=0x1003af420, zone=0x1002d9000, table=0x0, bundle=0x10032d9d0) at GSMarkupBundleAdditions.m:164
#16 0x0000000100285a78 in +[NSBundle(GSMarkupBundleAdditions) loadGSMarkupFile:externalNameTable:withZone:localizableStringsTable:inBundle:] (self=0x7fff704555a8, _cmd=0x1002965d0, fileName=0x1003ac480, context=0x1003af420, zone=0x1002d9000, table=0x0, bundle=0x10032d9d0) at GSMarkupBundleAdditions.m:148
#17 0x000000010028693e in -[NSBundle(GSMarkupBundleAdditions) loadGSMarkupFile:externalNameTable:withZone:localizableStringsTable:] (self=0x10032d9d0, _cmd=0x100296698, fileName=0x1003af460, context=0x1003af420, zone=0x1002d9000, table=0x0) at GSMarkupBundleAdditions.m:554
#18 0x00000001002869a3 in -[NSBundle(GSMarkupBundleAdditions) loadGSMarkupFile:externalNameTable:withZone:] (self=0x10032d9d0, _cmd=0x100296648, fileName=0x100020c28, context=0x1003af420, zone=0x1002d9000) at GSMarkupBundleAdditions.m:572
#19 0x000000010029323b in -[GSMarkupWindowController loadWindow] (self=0x1003ad070, _cmd=0x7fff84db146c) at GSMarkupWindowController.m:239
#20 0x00007fff84667199 in -[NSWindowController window] ()
#21 0x00007fff8487b399 in -[NSWindowController showWindow:] ()
#22 0x00007fff8484ce14 in -[NSDocument showWindows] ()
#23 0x00007fff849b91d9 in -[NSDocumentController openDocumentWithContentsOfURL:display:error:] ()
#24 0x00007fff849b888a in -[NSDocumentController _openDocumentsWithContentsOfURLs:display:presentErrors:] ()
#25 0x00007fff849b9793 in -[NSDocumentController(NSPrivate) _openRecentDocument:] ()
#26 0x00007fff847d6152 in -[NSApplication sendAction:to:from:] ()
#27 0x00007fff847fa6be in -[NSMenuItem _corePerformAction] ()
#28 0x00007fff847fa428 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] ()
#29 0x00007fff84a7e41d in -[NSMenu _internalPerformActionForItemAtIndex:] ()
#30 0x00007fff84930217 in -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] ()
#31 0x00007fff847dcc14 in NSSLMMenuEventHandler ()
#32 0x00007fff82682997 in DispatchEventToHandlers ()
#33 0x00007fff82681ee6 in SendEventToEventTargetInternal ()
#34 0x00007fff8269fba9 in SendEventToEventTarget ()
#35 0x00007fff826cecd1 in SendHICommandEvent ()
#36 0x00007fff826fbb06 in SendMenuCommandWithContextAndModifiers ()
#37 0x00007fff826fbabe in SendMenuItemSelectedEvent ()
#38 0x00007fff826fb9be in FinishMenuSelection ()
#39 0x00007fff826dccb3 in MenuSelectCore ()
#40 0x00007fff826dc408 in _HandleMenuSelection2 ()
#41 0x00007fff846adc39 in _NSHandleCarbonMenuEvent ()
#42 0x00007fff8468174e in _DPSNextEvent ()
#43 0x00007fff84680bed in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#44 0x00007fff846468d3 in -[NSApplication run] ()
#45 0x00000001000014b6 in main (argc=1, argv=0x7fff5fbfeff0) at main.m:60

Breakpoint 2, 0x00007fff846bee8b in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] ()
(gdb) bt
#0 0x00007fff846bee8b in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] ()
#1 0x00007fff81e1984e in _nsnote_callback ()
#2 0x00007fff80a70a90 in __CFXNotificationPost ()
#3 0x00007fff80a5d008 in _CFXNotificationPostNotification ()
#4 0x00007fff81e107b8 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#5 0x00007fff84652a4a in -[NSMenu removeItemAtIndex:] ()
#6 0x00007fff84898dff in -[NSPopUpButtonCell removeAllItems] ()
#7 0x00000001000034b6 in -[EOMEDocument updateItemsInPopUp:forEOClass:tableView:] (self=0x10053ee30, _cmd=0x100017811, popUpB=0x1003c91e0, eoclass=0x10016e358, tableView=0x100556bf0) at EOMEDocument.m:206
#8 0x0000000100003bdc in -[EOMEDocument awakeFromGSMarkup] (self=0x10053ee30, _cmd=0x100294c70) at EOMEDocument.m:288
#9 0x000000010027f0c1 in -[GSMarkupAwaker awakeObjects] (self=0x1003a3cc0, _cmd=0x100296870) at GSMarkupAwaker.m:64
#10 0x0000000100286127 in +[NSBundle(GSMarkupBundleAdditions) loadGSMarkupData:withName:externalNameTable:withZone:localizableStringsTable:inBundle:tagMapping:] (self=0x7fff704555a8, _cmd=0x1002964c0, data=0x1003a7230, fileName=0x1003ac480, context=0x1003af420, zone=0x1002d9000, table=0x1003ac5b0, bundle=0x10032d9d0, mapping=0x0) at GSMarkupBundleAdditions.m:361
#11 0x0000000100285aed in +[NSBundle(GSMarkupBundleAdditions) loadGSMarkupData:withName:externalNameTable:withZone:localizableStringsTable:inBundle:] (self=0x7fff704555a8, _cmd=0x100296550, data=0x1003a7230, fileName=0x1003ac480, context=0x1003af420, zone=0x1002d9000, table=0x0, bundle=0x10032d9d0) at GSMarkupBundleAdditions.m:164

Breakpoint 2, 0x00007fff846bee8b in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] ()
(gdb) bt
#0 0x00007fff846bee8b in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] ()
#1 0x00007fff81e1984e in _nsnote_callback ()
#2 0x00007fff80a70a90 in __CFXNotificationPost ()
#3 0x00007fff80a5d008 in _CFXNotificationPostNotification ()
#4 0x00007fff81e107b8 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#5 0x00000001000036aa in -[EOMEDocument updateItemsInPopUp:forEOClass:tableView:] (self=0x10053ee30, _cmd=0x100017811, popUpB=0x1003c91e0, eoclass=0x10016e358, tableView=0x100556bf0) at EOMEDocument.m:236
#6 0x0000000100003bdc in -[EOMEDocument awakeFromGSMarkup] (self=0x10053ee30, _cmd=0x100294c70) at EOMEDocument.m:288
#7 0x000000010027f0c1 in -[GSMarkupAwaker awakeObjects] (self=0x1003a3cc0, _cmd=0x100296870) at GSMarkupAwaker.m:64

David Wetzel <dwetzel>
Project Member
Wed 28 Jul 2010 09:17:57 AM UTC, comment #2:

The second issue is caused by the fact that your code manipulated the menu of the popup button without calling synchronizeTitleAndSelectedItem. It is surprising that this is working on Cocoa. To me this is rather an application bug than a GNUstep limitation.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Thu 15 Jul 2010 07:42:59 AM UTC, comment #1:

I fixed the first issue in SVN, please have a look whether this works for you.

As for the second issue, could you please provide an image showing how this looks on Cocoa? I think both you images are form GNUstep one immediately after opening the popup the first time and the second when opening it again. Is this correct?

The expected behaviour may be obvious to you, but I will need some more explanation to grasp it.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Tue 01 Jun 2010 05:29:03 PM UTC, original submission:

I am using an menu into a corner view of a NSTableView.

  • The Menu item has not the right width until it is activated.
  • The first Menu item should be used to display the corner view cell.

The checkbox in the first menu item is wrong.

See

- (void) updateItemsInPopUp: forEOClass: tableView:

in gdl2/Apps/EOModelEditor/EOMDocument.m

for code.

David Wetzel <dwetzel>
Project Member

 

Attached Files
file #20987:  macmenu.png added by dwetzel (73KiB - image/png - mac menu)
file #20672:  menu1.png added by dwetzel (10KiB - image/png)
file #20673:  menu2.png added by dwetzel (14KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by dwetzel (Submitted the item)
  •  

    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 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 Nov 2011 07:18:14 PM UTCFredKieferOpen/ClosedIn Test=>Closed
    Tue 10 Aug 2010 10:18:14 PM UTCdwetzelStatusReady For Test=>Fixed
    Tue 10 Aug 2010 09:47:05 PM UTCFredKieferOpen/ClosedOpen=>In Test
    Mon 02 Aug 2010 05:44:20 PM UTCdwetzelOpen/ClosedIn Test=>Open
    Wed 28 Jul 2010 09:17:57 AM UTCFredKieferStatusIn Progress=>Ready For Test
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>In Test
    Thu 15 Jul 2010 05:37:58 PM UTCdwetzelAttached File-=>Added macmenu.png, #20987
    Thu 15 Jul 2010 07:42:59 AM UTCFredKieferStatusNone=>In Progress
    Tue 01 Jun 2010 05:29:03 PM UTCdwetzelAttached File-=>Added menu1.png, #20672
      Attached File-=>Added menu2.png, #20673

    Back to the top


    Powered by Savane 3.1-cleanup1