MaxGUI RequestFont appearance?

Archives Forums/MacOS X Discussion/MaxGUI RequestFont appearance?

WendellM(Posted 2005) [#1]
I'm wondering what RequestFont is supposed to look like under MaxGUI on a Mac. I have Suitcase X1 installed on mine, and when I use RequestFont, I see this:



There's no "OK" button or anything to actually lock in my font choice, and if I just close the window with the upper-left button, RequestFont doesn't load anything. That is, I always get "Null" when running:
Local GFont:TGUIFont = RequestFont()
If GFont = Null Then Print "Null"
I'm not sure if it's Suitcase that's causing this, though, since if I click the little gear button at the bottom and select "Manage Fonts", I get Font Book rather than Suitcase.

So, am I overlooking something simple, or does anyone else have an "OK button" or something like it when using RequestFont on a Mac?


Brucey(Posted 2005) [#2]
I believe the font panel is the standard font requester on OSX.
If you try the RequestFont example in the help, you'll probably find it doesn't work either :-)

From messing about with it a bit, it seems that the font panel should be returning font details as you click on stuff in the panel itself (ie. live feedback), rather than being a modal wait-for-a-font window.

To see what I mean, open TextEdit, type some text, highlight it, then open the font panel (Format -> Font -> Show Fonts), and change the font. You'll notice the font in the editor changes on-the-fly.

a max mac bug, me thinks?

:o)


WendellM(Posted 2005) [#3]
Thanks. I see what you mean with TextEdit.

RequestFont does work in Max's IDE on a Mac, but you're right: the RequestFont example in the help does not work on a Mac. So something seems weird.

Thanks for the info - I wanted to make sure that I wasn't overlooking something basic and that it wasn't Suitcase interfering before reporting this as a bug. But since the RequestFont example itself doesn't work, I'll go ahead and post about this in the bugs forum.


Tricky(Posted 2005) [#4]
Apple does not believe in "Ok" buttons. And I think Mark forgot about that. Nearly all programs written for Mac using this Font Panel, respond either immediately once you make your selection, or when you click the "close" buttton. I think Mark didn't take that in mind.... :(


Brucey(Posted 2005) [#5]
I managed to get the example to work...

After looking at MaxIDE source, the font parameter that is passed into RequestFont will always be an instance of a font object. In the example, "font" isn't defined when RequestFont is called.
If you add something like :

font=LoadGuiFont("Arial",12)

so that "font" is an instance of TGuiFont when you call RequestFont, it will return correctly the font you choose from the font panel.

I'd still say that's a bug tho...

:o)


WendellM(Posted 2005) [#6]
You're right - thanks for the follow-up. I'd seen that RequestFont took a Font parameter in MaxIDE, so I tried "GFont:TGuiFont = RequestFont( GFont )" but that didn't work since GFont was Null.

Using GFont:TGuiFont = RequestFont( LoadGuiFont( "Courier", 10 ) ) works, but only if the font Loaded is valid (so a typo like "Cuorier" returns Null). Thus you need to know at least one valid font on the Mac (call it the "traitor font" <g>) to use RequestFont to find out the rest.

I'll update my bug report with this info. At the least, I'd think that the help should be updated to mention this requirement on a Mac.

Tricrokra, maybe(?) the need for "live" font update on a Mac is why a font object needs to be passed to the requester.