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

 
 

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

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

Submitted by:  julian <julian_>
Submitted on:  Thu 06 Oct 2011 11:17:21 AM UTC  
Votes:  20  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

(Jump to the original submission 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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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_>

 

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
  • -unavailable- added by julian_ (Voted in favor of this item)
  • -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 20 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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 Nov 2011 07:13:30 PM UTCFredKieferStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Mon 31 Oct 2011 09:59:41 PM UTCFredKieferStatusConfirmed=>Ready For Test
      Open/ClosedOpen=>In Test
    Sun 09 Oct 2011 08:11:19 PM UTCFredKieferStatusNone=>Confirmed
      Assigned toNone=>FredKiefer
    Thu 06 Oct 2011 12:21:46 PM UTCjulian_Carbon-Copy-=>Added julian_
    Thu 06 Oct 2011 11:54:30 AM UTCjulian_Attached File-=>Added gnustepbug.tar.gz, #24114

    Back to the top


    Powered by Savane 3.1-cleanup1