Le 30/04/2019 à 18:33, David Chisnall a écrit :
On 30/04/2019 15:34, Bertrand Dekoninck wrote:
OK, thanks for your quick answer. I don't see any either, but I could try to modify NSButtonCell.h locally to have this method public. Maybe I need more help.

Normally, the fix for this kind of thing is to declare a category on NSButtonCell that exposes the method that you want.  It's somewhat fragile, so best practice would be to have a dynamic check in your +initialize that checks that the method does exist.

While investing in this way, I wondered if a solution of the kind hereafter would be correct :

I replace this  :

 GSThemeControlState buttonState =  [self themeControlState];

(which caused a warning because themeControlState is not public, and an error with gcc because GSControlState is not a pointer... )

with that :

 SEL aSelector = @selector(themeControlState);
 GSThemeControlState buttonState =  (GSThemeControlState)[self performSelector:aSelector withObject:nil];


I don't have any warning when a replace the direct call to themeControlState with a selector + a cast in this way.


What do you think, guys ?

Cheers, Bertrand


_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to