Code: Select all
LoadFont(0, "Arial", 36)
SetGadgetFont(#PB_Default, FontID(0))
#Dialog = 0
#Xml = 0
XML$ = "<window id='#PB_Any' name='test' text='Dialog example' minwidth='300' minheight='300' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <button text='myButton'/>" +
"</window>"
If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
CompilerIf #PB_Compiler_OS <> #PB_OS_Web
Repeat
Until WaitWindowEvent(0) = #PB_Event_CloseWindow
CompilerEndIf
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf