OK I figured out how to add a minimise button to graphics windows created on Mac OSX with Graphics w,h,0.
A minimise button cannot be added once the window is created (according to the Mac Developer docs) only as the window is created. So I had to modify glgraphics.macos.m by finding this line (990):
and changing it to:
Then rebuild modules.
This works and when you click minimise it does minimise, woo! However it not passing a suspended event into BMax so I can't stop the music and can't stop game logic which is naff.
However, I've no idea where to go from here. I.e. how to detect the minimise. Probably another module needs to be modified so that an AppSuspend event is fired off when the game is minimised. Can anyone help with this as it would be great to get it sorted for the Mac! Thanks in advance.
A minimise button cannot be added once the window is created (according to the Mac Developer docs) only as the window is created. So I had to modify glgraphics.macos.m by finding this line (990):
style=NSTitledWindowMask|NSClosableWindowMask
and changing it to:
style=NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
Then rebuild modules.
This works and when you click minimise it does minimise, woo! However it not passing a suspended event into BMax so I can't stop the music and can't stop game logic which is naff.
However, I've no idea where to go from here. I.e. how to detect the minimise. Probably another module needs to be modified so that an AppSuspend event is fired off when the game is minimised. Can anyone help with this as it would be great to get it sorted for the Mac! Thanks in advance.