Code: Select all
#Font = 0
If OpenWindow(0, 0, 0, 600, 600, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
font=LoadFont(#Font,"Segoe UI",11,#PB_Font_HighQuality)
If font
SetGadgetFont(#PB_Default,FontID(#Font))
EndIf
CanvasGadget(0, 10, 10, WindowWidth(0)-20, WindowHeight(0)-20,#PB_Canvas_Container)
If StartDrawing(CanvasOutput(0))
DrawingMode(#PB_2DDrawing_Gradient)
BackColor($D8D8DD)
FrontColor($FFFFFF)
LinearGradient(0, 50, 0, WindowHeight(0)-20)
Box(0,0,WindowWidth(0)-20,WindowHeight(0)-20,$FFFFFF) ; <-- you would need to get the default window color somehow, if that's what you want.
DrawingMode(#PB_2DDrawing_Default)
LineXY(0,0,0,WindowHeight(0)-20,$A0A0A0)
LineXY(0,0,WindowWidth(0)-20,0,$A0A0A0)
LineXY(WindowWidth(0)-21,0,WindowWidth(0)-21,WindowWidth(0)-21,$A0A0A0)
LineXY(0,WindowHeight(0)-21,WindowWidth(0)-21,WindowHeight(0)-21,$A0A0A0)
StopDrawing()
EndIf
OptionGadget(2,30,30,100,30,"Option")
ButtonGadget(3,30, 80 , 100, 50, "Click Me",#PB_Button_Default)
StringGadget(4,30, 140, 300, 30, "Sample text")
StringGadget(5,30, 180, 300, 30, "Sample text 2")
CloseGadgetList()
DisableGadget(0,false)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf