I’m still using BlitzMax+MaxGUI to create little applications in my daily work.
Recently I changed my monitor to a 22″ and the old apps I wrote seems very ‘small’ on the new monitor.
So I’m changing the window’s size of all the apps to ‘see’ them in a good manner.
I decided to put in the .ini file a GUI_SIZE parameter for the font used.
So I discovered that the command SetGadgetFont() works ONLY for a single gadget. At the time!
So I changed the MaxGUI source code, in maxgui.bmx
Rem bbdoc: Set a gadget's font. about: See #LoadGuiFont and #RequestFont for creating a @TGuiFont. EndRem Function SetGadgetFont( gadget:TGadget,font:TGuiFont ) gadget.SetFont( font ) If GadgetClass(gadget)=GADGET_WINDOW Or GadgetClass(gadget)=GADGET_PANEL For Local gk:Tgadget=EachIn gadget.kids if gk SetGadgetFont(gk,font) Next End If End Function
Basically if the gadget parameter is a window or a panel they probably have gadget kids, and so I call recursevely the function to apply the new font. In one single call.
Handy.
The next step: find a way to setup a ‘default aspect ratio’ for a MaxGUI application.