I'm getting down and dirty learning how to use structs as it is important if I want to move windows, resize windows, and a million other things. I got the basics working, for instance in my test I successfully moved a window. But to resize it I'm bumping my head against a wall. First I tried doing it without structs by doing setContentSize. But this did absolutely nothing, so I'm not sure why it's even listed lol. (It's under NSWindow>sizing content)
So next I settled on setFrame:display: as the next likely candidate. It says it will resize the window. But I ran into trouble...
Here's some code:
NSRect windowBounds;
NSPoint windowOrigin;
NSSize windowSize;
So I have three structs here. Trouble is, the NSPoint and the NSSize are supposed to be "children" of the NSRect. They are what make up an NSRect. How do I go about "putting" them into the NSRect, then editing their content.
Here's what I tried doing:
windowBounds.windowSize.width = 50;
error: 'NSRect' has no member named 'windowSize'
Can anyone help? Thanks!
So next I settled on setFrame:display: as the next likely candidate. It says it will resize the window. But I ran into trouble...
Here's some code:
NSRect windowBounds;
NSPoint windowOrigin;
NSSize windowSize;
So I have three structs here. Trouble is, the NSPoint and the NSSize are supposed to be "children" of the NSRect. They are what make up an NSRect. How do I go about "putting" them into the NSRect, then editing their content.
Here's what I tried doing:
windowBounds.windowSize.width = 50;
error: 'NSRect' has no member named 'windowSize'
Can anyone help? Thanks!