bugGNUstep - Bugs: bug #34492, [Bindings] selectedIndex binding...

Group
 
 

bug #34492: [Bindings] selectedIndex binding of NSPopUpButton broken

Submitter:  julian <julian_>
Submitted:  Thu 06 Oct 2011 11:17:21 AM UTC
Votes: 20
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 06 Nov 2011 07:15:14 PM UTC, comment #10: 

thanks it seems to be fixed for my real app too.

julian <julian_>
Sun 06 Nov 2011 05:22:39 PM UTC, comment #9: 

I just added another fix, that is the code now uses the action _popUpItemAction: as the default action for the menu item.

Could you please test whether this resolves your problem. If not, we will have to reopen this case and a new test application would then be very helpful.

Fred Kiefer <FredKiefer>
Group Member
Sat 05 Nov 2011 07:12:38 PM UTC, comment #8: 

sorry, although the test-app works fine now, the problem still exists in my full app.

the reason is that your fix only works if the menu items are added to the nspopupbutton in interface builder.

i am adding all my menu items with addItemWithTitle: and in this case

1.) there are no checkmarks on the menu items (i don't need them anyway)
2.) the selectedIndex binding still doesn't work


should i modify the sample to show this issue?

julian <julian_>
Mon 31 Oct 2011 11:49:04 PM UTC, comment #7: 

thanks! the test-sample works fine now.

i'll be removing all the workaround code (quite a lot for this bug) from my real app and re-test it too during this week - if there are any remaining issues i will file new bugs.

julian <julian_>
Mon 31 Oct 2011 09:59:41 PM UTC, comment #6: 

Instead of re-thinking the cell/control interaction I just added a quick fix where the cell informs the binding on the control that the value has changed. This should fix you problem, but I still have some more thinking to do :-(

Please give it a try.

Fred Kiefer <FredKiefer>
Group Member
Sun 09 Oct 2011 11:17:35 PM UTC, comment #5: 

thanks for looking into it!

it seems the issue is quite fundamental and i guess there is no easy workaround.

i assume any fix to this will also fix #34471 which is also related to bindings and cells (but of minor importance).

julian <julian_>
Sun 09 Oct 2011 08:11:19 PM UTC, comment #4: 

Looks like the problem you are having comes from the way the popup cell and the popup button don't interact. in GNUstep we only define the binding on the control, in this case the button and the selection mechanism of the cell is by passing this when the user selects a different entry that way no binding change notification will ever get passed on.
Looks like I have to rethink the role of cells in the binding mechanism and come up with a slightly different implementation.

Fred Kiefer <FredKiefer>
Group Member
Fri 07 Oct 2011 04:21:24 PM UTC, comment #3: 

i can't find the problem in NSPopUpButton.m

perhaps the fault is in the user defaults controller?

julian <julian_>
Thu 06 Oct 2011 11:54:30 AM UTC, comment #2: 

minimal sample attached

select the last item from the popupbutton

on mac os x it NSLog()s :

popup item selected 2

on gnustep:

popup item selected 0

(file #24114)

julian <julian_>
Thu 06 Oct 2011 11:23:06 AM UTC, comment #1: 

Yes, a minimal example would be quite helpful as I am almost sure I implemented this binding.

Fred Kiefer <FredKiefer>
Group Member
Thu 06 Oct 2011 11:17:21 AM UTC, original submission:  

1.) bind an NSPopUpButton selectedIndex to a key of the shared user defaults controller
2.) set an action method for the NSPopUpButton that reads the key from the user defaults controller
3.) run the app and select something from the  popup - the action method gets called but it always reads 0 as the key from the user defaults

if you need a minimal sample showing the issue i could make one.

julian <julian_>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #24114:  gnustepbug.tar.gz added by julian_ (6KiB - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by julian_ (Voted in favor of this item)
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by julian_ (Submitted the item)
  •  

    There are 20 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-11-01 FredKiefer StatusReady For Test Fixed
        Open/ClosedIn Test Closed
    2011-10-31 FredKiefer StatusConfirmed Ready For Test
        Open/ClosedOpen In Test
    2011-10-09 FredKiefer StatusNone Confirmed
        Assigned toNone FredKiefer
    2011-10-06 julian_ Carbon-Copy- Added julian_
    2011-10-06 julian_ Attached File- Added gnustepbug.tar.gz, #24114

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code