mrbannon
2006.07.17, 05:54 PM
Hello,
I'm porting a game from PC to Mac. The game uses SDL for events and display. The original authors decided to not allow a resizable window. As such, when the window appears, the zoom button is not there. However, I need it to appear (after which I will change the functionality, but getting it to appear is my first priority).
My problem is that I can't seem to successfully change any attributes of my window. I've tried the following code (I can provide a full example if requested):
// There would be my SDL initialization here...along with setting video mode.
// ...
// Next, get the window reference (is this even the right way to do it)?
// It's my understanding that GetWindowList() returns a list of windows for this process.
WindowRef window = GetWindowList();
// Change the attribute.
OSStatus error = ChangeWindowAttributes(window, kWindowResizableAttribute, kWindowNoAttributes);
When I first tried this, I would get an error saying that the attribute couldn't be applied to the window class. So, before the attribute change, I would change the class to "kFloatingWindowClass". That produced no errors, but no zoom button.
So, I'm clearly doing something wrong. And I'm sure it's more than just one thing. Any help is greatly appreciated.
Thanks,
Ryan
ps - If you're curious, I want the zoom button to act as a fullscreen button, but I don't want the app to be resizable.
I'm porting a game from PC to Mac. The game uses SDL for events and display. The original authors decided to not allow a resizable window. As such, when the window appears, the zoom button is not there. However, I need it to appear (after which I will change the functionality, but getting it to appear is my first priority).
My problem is that I can't seem to successfully change any attributes of my window. I've tried the following code (I can provide a full example if requested):
// There would be my SDL initialization here...along with setting video mode.
// ...
// Next, get the window reference (is this even the right way to do it)?
// It's my understanding that GetWindowList() returns a list of windows for this process.
WindowRef window = GetWindowList();
// Change the attribute.
OSStatus error = ChangeWindowAttributes(window, kWindowResizableAttribute, kWindowNoAttributes);
When I first tried this, I would get an error saying that the attribute couldn't be applied to the window class. So, before the attribute change, I would change the class to "kFloatingWindowClass". That produced no errors, but no zoom button.
So, I'm clearly doing something wrong. And I'm sure it's more than just one thing. Any help is greatly appreciated.
Thanks,
Ryan
ps - If you're curious, I want the zoom button to act as a fullscreen button, but I don't want the app to be resizable.