bugGNUstep - Bugs: bug #34923, nib loading problem: wrong...

 
 

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

bug #34923: nib loading problem: wrong NSPopupButton item by selected

Submitted by:  julian <julian_>
Submitted on:  Mon 28 Nov 2011 01:58:12 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Mon 28 Nov 2011 09:29:34 PM UTC, comment #3:

Looks like you did just the same check as I :-)
But for me the NSSelectedIndex got set in the NSPopUpButtonCell, just as we expected it. What we had not handled before was the case of a missing selection index, which happens as you found out for the zero case.
Our SVN code now handles this correctly. But for some reason the item doesn't look selected at first. And as I wrote just selecting it was also not enough, there is a bit more going on here, but the fix should be good enough for now.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 28 Nov 2011 08:48:33 PM UTC, comment #2:

thanks. it seems the selection is stored in two methods in NIB files, but both in the NSMenu and not the NSPopupButton directly:

the selected menu item does have a "1" state:
<int key="NSState">1</int>

if the selected item is not the first one (i.e. item zero), the selected index is stored additionally:

<int key="NSSelectedIndex">1</int>

i've attached the same nib file with the second item being selected for reference

(file #24490)

julian <julian_>
Mon 28 Nov 2011 08:34:01 PM UTC, comment #1:

I just committed a patch for this problem. Now when no selection is given in the NIB file we select the first entry.
I don't like this solution too much, perhaps it would be better to always select the first item when setting the menu. This fix also needed the decoding of the menu item and this seems wrong to me.

Perhaps somebody else is willing to have a second look at this issue?

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 28 Nov 2011 01:58:12 PM UTC, original submission:

attached is a sample app which consists of a single NIB file which only has a single NSPopupButton. when starting the application, for some reason the last popup item is selected, while the first one should actually be selected.

julian <julian_>

 

Attached Files
file #24490:  MainMenu.zip added by julian_ (9KiB - application/zip)
file #24486:  gnustepbug.tar.gz added by julian_ (18KiB - application/x-gzip)

 

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 julian_ (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Mar 2013 10:24:33 PM UTCFredKieferStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Mon 28 Nov 2011 08:48:33 PM UTCjulian_Attached File-=>Added MainMenu.zip, #24490
    Mon 28 Nov 2011 08:34:01 PM UTCFredKieferStatusNone=>Ready For Test
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>In Test
    Mon 28 Nov 2011 01:58:12 PM UTCjulian_Attached File-=>Added gnustepbug.tar.gz, #24486

    Back to the top


    Powered by Savane 3.1-cleanup1