Code: Select all
result = LoadFont(#PB_Any, "Arial", 8, #PB_Font_Bold)
SetGadgetFont(control_id, result)Code: Select all
result = LoadFont(#PB_Any, "Arial", 8, #PB_Font_Bold)
SetGadgetFont(control_id, result)Code: Select all
If OpenWindow(0,0,0,222,130,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"SetGadgetFont") And CreateGadgetList(WindowID(0))
  ButtonGadget(0,10,10, 200, 30, "Button - Arial 8")
  result = LoadFont(#PB_Any, "Arial", 8, #PB_Font_Bold)
  SetGadgetFont(0, FontID()) ;<---------------
EndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindowCode: Select all
If OpenWindow(0,0,0,222,130,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"SetGadgetFont") And CreateGadgetList(WindowID(0))
  ButtonGadget(0,10,10, 200, 30, "Button - Arial 8")
  result = LoadFont(#PB_Any, "Arial", 8, #PB_Font_Bold)
  SetGadgetFont(0, UseFont(result))
EndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Ok, but it still seems that result could contain the same value as FontID() (and that value could be used in UseFont).Paul wrote:The return result is for use with the "Use" command...
Code: Select all
If OpenWindow(0,0,0,222,130,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"SetGadgetFont") And CreateGadgetList(WindowID(0)) ButtonGadget(0,10,10, 200, 30, "Button - Arial 8") result = LoadFont(#PB_Any, "Arial", 8, #PB_Font_Bold) SetGadgetFont(0, UseFont(result)) EndIf Repeat Until WaitWindowEvent() = #PB_Event_CloseWindow