StartProGUI

Syntax

Success = StartProGUI(GfxDriver=#Null)

Description

Initializes the ProGUI subsystem. This must be the very first ProGUI command called in an application.

Parameters

GfxDriver (optional)
Force a specific rendering subsystem. Use #PG_RenderDirect2D or #PG_RenderCairo. If #Null, ProGUI automatically attempts to load the most optimal driver for the operating system.

Return Value

Returns #True if initialization was successful. Returns #False if it was already called or failed.

Remarks

Must be the very first ProGUI command executed in your application. StartProGUI() spawns essential background threads (such as the continuous Animation Thread and Mouse Hook listeners). It initializes default system metrics (DPI, CSS color variables), sets up the base CSS skin dictionaries, and prepares thread-safety mutexes.

Example

IncludeFile "ProGUI_PB.pbi"

; Initialize ProGUI using the default graphics driver
If Not StartProGUI()
  MessageRequester("Error", "Failed to initialize ProGUI!")
  End
EndIf

; Create a window and do UI work...
MyWindow = CreateWindow(0, 0, 400, 300, "ProGUI Started")
If MyWindow
  WindowShow(MyWindow, #True, #PG_WindowShow_ScreenCentered)
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

; Shut down the framework
StopProGUI()

See Also

StopProGUI

Supported OS

Windows, Linux