[OSX] Alignment and GUIFont on Buttons

BlitzMax Forums/MaxGUI Bug Reports/[OSX] Alignment and GUIFont on Buttons

While working on a little app I recognised, that setting a GUIFont on a button doesn't do anything.
Brucey mentioned this issue about three years ago.

The second issue is, that when you create a button without any text and use SetGadgetText on it, the text will be left aligned instead of centered.


Code Snippet:
Import maxgui.drivers
Import brl.eventqueue

Local GUIFONT:TGUIFont = LoadGuiFont (FontName(LookupGuiFont (GUIFONT_SYSTEM)), 18 , 0)
If Not GUIFONT Notify ("Font failed")

Local WIN:TGadget = CreateWindow ("GUI vs. Buttons: Round 1", 0, 0, 300, 250, Null, WINDOW_TITLEBAR|WINDOW_CENTER|WINDOW_CLIENTCORDS)

Local BUT1:TGadget = CreateButton ("Normal", 10, 10, 280, 70, WIN)

Local BUT2:TGadget = CreateButton ("",10, 80, 280, 70, WIN)
SetGadgetText (BUT2,"Failed Alignment")

Local BUT3:TGadget = CreateButton ("Failed SetGUIFont",10, 150, 280, 70, WIN)
SetGadgetFont (BUT3,GUIFONT)


Repeat

	Select WaitEvent ()
		Case EVENT_APPTERMINATE, EVENT_WINDOWCLOSE
			End
	End Select


Forever


Result:


I'm using latest SVN revision of MaxGUI.

cheers

Hi,

Thanks for posting a bug report. I'll take a look next time I have access to a Mac but seeing as I'm away from home, it isn't likely to be soon.

Btw, I thought I'd mention that this line...

Local GUIFONT:TGUIFont = LoadGuiFont (FontName(LookupGuiFont (GUIFONT_SYSTEM)), 18 , 0)
Can be simplified to...

Local GUIFONT:TGUIFont = LookupGuiFont (GUIFONT_SYSTEM, 18 , 0)
;-)

Still on yer hols, Seb? ;-)

Why to do it simple when you can do it complicated? :D
(Shame on me!)

Nice holidays, Seb