Closed LoganDark closed 4 years ago
@LoganDark you need to switch that docs page to the Objective-C language: https://developer.apple.com/documentation/appkit/nsfont/1533549-boldsystemfontofsize?language=objc
Then you'll see that the method name in Objective-C is boldSystemFontOfSize:
. So the code you'd want is something like:
let font: *mut Object = msg_send![class!(NSFont), boldSystemFontOfSize:size];
Oh, thank you! :D
size
is a*mut NSObject
Also, unless that was a typo, you'll see in the method signature that size
should be a CGFloat
rather than an object.
Huh, I assumed all things in Objective-C were objects... this is my first day D:
objc
doesn't provide a CGFloat type, is there an equivalent in Rust (like is it just an f32
?) or anything?
Also where should I go in the future to get help on this? I don't like having to bother the repository owner for help, you probably have way better things to do :p
Edit: Seems like specifying f32
or f64
as the return type both work... the docs say it's a double on 64-bit architectures so I guess I'm gonna do f64
.
I'm trying to call NSFont.boldSystemFont, but I can't figure out how. This doesn't work (
size
is a*mut NSObject
):Or this:
Or this:
Or this:
Or this:
Or this:
Or this:
Or this:
Or this:
I feel like I've tried everything, but this is just so basic that
objc
MUST have functionality for it somewhere... right?Please help me, I've spent way too much time trying to figure this out... That's not even everything I tried, but I don't want to make this issue any longer!