Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement integerValue method in NSSliderCell #296

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

williameveretteggplant
Copy link
Contributor

When you call setIntegerValue: method on an NSSliderCell, it calls the superclass method in NSCell, which then calls setObjectValue:. The implementation of setObjectValue: in NSSliderCell sets the _value ivar. The problem is, when you call integerValue: it calls the superclass method in NSCell, which returns a value based on the _object_value ivar, which has not been set.
By implementing the integerValue: method directly in NSSliderCell, this will return the correct value.

the superclass method integerValue: method in NSCell uses the _object_value to retrieve the result, but the implementation of setObjectValue: in NSSliderCell sets _value. So integerValue: needs to return _value.
Copy link
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more consistent if you also add an setIntegerValue: method. I wait a while with merging to leave you some time for that.

@fredkiefer
Copy link
Member

Sadly it did not happen so I merge without it.

@fredkiefer fredkiefer merged commit 3b02ac1 into gnustep:master Oct 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants