Porting from Win 32 - Newbie issues...

Archives Forums/MacOS X Discussion/Porting from Win 32 - Newbie issues...

Grisu(Posted 2009) [#1]
Hey guys.

Charlie and I are working on a Mac port of my little internet radio player.



1.
Can one keep the front / gadget size on both platforms?


2.
Buttons seem to "broken" as well (cut off).

Is there a way to avoid this to happen?

3.
OpenURL ("http://www.charliesgames.com/prp/prp_check.php?version="+APP_VERSION:String)

OpenURL crashes the Apple. Any secret for this simple command?

4.
Images doesn't show up in a canvas.
Are those not used unter Mac? Shall I use a pixmap instead.

Secret hints that make porting easier are welcome.
For now it is a pain in the...

Grisu


Brucey(Posted 2009) [#2]
Hi :-)

1) No. controls are usually taller on OS X. (this is something you need to take into consideration in your design if you intend using MaxGUI on multiple platforms).

2) You may get away with using a toggle button (or something similar - I can't remember which MaxGUI button was "square", and displayed images well).
Or, a Panel.

3) Should work.

4) That should work fine also.


If you need a hand, give me a shout. Don't want to competition to fail at the starting line :-)


degac(Posted 2009) [#3]
Are you using 'standard' MaxGUI or 'SVN MaxGUI'? Maybe there are some updates for MacOS X too during the last year...


Grisu(Posted 2009) [#4]
I'm using the SVN MaxGUI.


d-bug(Posted 2009) [#5]
Button height <= 20 will produce square buttons.
Combobox height should be 24 (looks best). >= 30 throws an Cocoa bugreport.


SebHoll(Posted 2009) [#6]
Hey Grisu,

Buttons seem to "broken" as well (cut off).

I tweaked CocoaMaxGUI so that buttons greater than 30 pixels tall should appear square (as opposed to with a rounded edge). Try a height of 32 pixels and see if that's any better.

For general MaxGUI cross-platform advice, Skid wrote a bit under Help -> Tutorials -> MaxGUI Overview.

Crossplatform Issues
In general the MaxGUI module should perform identically on Windows, Apple and Linux machines. However some care and attention is required when testing in regards to how your application will look on each platform.

The following are a few issues that if considered should hopefully enable you to publish programs that look and function well on a wide variety of systems.

Recomended gadget dimensions.


Buttons and ComboBoxes should be 24 pixels high.
Shorter buttons are possible in Windows but they will become cropped on Apple systems so it is recomended that when using the default font buttons should be created with a height of 24 pixels.


TextFields should be 20 pixels high and accompanying labels lowered 4 pixels.
Again, using the default font settings, the above rule should produce good results on all platforms. Often labels will be placed to the left or right of TextFields, in which case they should be set 4 pixels lower down the screen in order to correctly align with TextFields.


Separate fields in a form by 30 pixels.
When creating a form with multiple TextField gadgets start each row 30 pixels below the y position of the previous gadget's positions.

Use the WINDOW_CLIENTCOORDS flag when dependent on client size.

If you are using a fixed size window specify it's size based on the required client area using the WINDOW_CLIENTCOORDS style.

Specifying a window's size in the default frame coordinates will result in a client area that may be different on different machines due to a number of factors including both the version of the computer's operating system and certain user preference outside your control.

It is slightly out-of-date when it comes to buttons, which I prefer to be 26 pixels tall for standard buttons and 32 pixels tall for image buttons. I use this combination for MaxIDE's dialog boxes and it seems to work well across platforms.


Brucey(Posted 2009) [#7]
I went with panels instead - easier.


Grisu(Posted 2009) [#8]
I went with panels cause Brucey said so... ;o)

@Seb:
Is there are reason why icons aren't supported for combo boxes under Mac?


Brucey(Posted 2009) [#9]
Is there are reason why icons aren't supported for combo boxes under Mac?

From my investigations, native comboboxes do not support images. (No, I'm not Seb in disguise! :-p )