Download()
Loads the MaterializeCSS stylesheets and JavaScript files required by MaterialSB. This function must be called before using any other MaterialSB functions.
Syntax
MaterialSB::Download(*Callback)
Parameters
| Parameter | Description |
|---|---|
*Callback |
A procedure address that will be called when loading completes. The callback receives a single boolean parameter: #True on success, #False on failure. |
Return Value
None. The result is passed to the callback function.
Remarks
Download() performs the following setup operations:
- Loads the MaterializeCSS stylesheet
- Loads the Material Icons font
- Loads the MaterializeCSS JavaScript library
- Removes SpiderBasic's default Dojo/Flat styles
- Enables dark theme by default
- Creates the main content container
All UI building code should be placed inside the callback function to ensure the library is fully loaded before creating components.
Example
IncludeFile "MaterialSB.sbi"
Procedure Main(Success)
If Success
; MaterialSB is ready - build your UI here
MaterialSB::Row(MaterialSB::#Grid_Container)
MaterialSB::Col(12)
MaterialSB::Append(MaterialSB::Header("Hello MaterialSB!", 2))
MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
Else
Debug "Failed to load MaterialSB"
EndIf
EndProcedure
; Start the application
MaterialSB::Download(@Main())