For my application I want to set a custom length and width for my NSWindow from within the application itself. I have everything set up (the NSTextfields) however I’m stumped with how I should do it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NSRectis defined like this:And
NSSizeis defined like this:You need to convert your
NSStrings to numbers first. You can do that like this:(I don’t actually remember if
CGFloatis defined as afloatordouble. I’m just too lazy to look it up right now.) Note that this will cause an exception ifstringValuedoes not represent a properly formatted number.