Syntax
ThemeName$ = SkinGetTheme(Skin=#Null)
Description
Retrieves the name of the currently active theme within the specified skin.
Parameters
Skin (optional)
The handle of the skin object to query. If #Null,
the current default skin is used. Default is #Null.
Return Value
Returns the name of the active theme as a string (e.g., "dark", "contrast"). Returns an empty string ("") if the base (default) theme is active or if the skin handle is invalid.
Remarks
Themes allow a single skin to contain multiple visual variations (e.g., light and dark modes). The active theme determines which theme-specific rules (e.g., `dark:button`) are considered during style resolution. Use SkinSetTheme() to change the active theme.
Example
IncludeFile "ProGUI_PB.pbi"
StartProGUI()
; Assume a skin was loaded or created and set as default
; Set the theme to "dark"
SkinSetTheme("dark")
; Get the current theme
CurrentTheme
=SkinGetTheme()Debug"Currenttheme:"+CurrentTheme=SkinGetTheme()Debug"Currenttheme:"+CurrentTheme
; Should output "dark"
; Switch back to the default theme
SkinSetTheme("")
CurrentTheme
=SkinGetTheme()Debug"Currentthemeafterreset:′"+CurrentTheme=SkinGetTheme()Debug"Currentthemeafterreset:′"+CurrentTheme
+ "'" ; Should be empty
StopProGUI()
See Also
SkinSetTheme, LoadSkin, SkinSetDefault
Supported OS
Windows, Linux