The following code works as expected on Mac OSX but not on Windows.
Tested on Windows 10 with PureBasic 5.50 64 bit and PureBasic 5.51 64 bit.
Code:
EnableExplicit
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
#Dialog = 0
#Xml = 0
Global XML$, Event.i
EnableExplicit
Runtime Enumeration ;Windows
#WinMain
EndEnumeration
Runtime Enumeration ;Gadgets
#CanvasTest
EndEnumeration
Runtime Enumeration ;Fonts
#VFont_01
EndEnumeration
Runtime Procedure SetUP()
Protected T$
LoadFont(#VFont_01,"Arial",48)
If StartVectorDrawing(CanvasVectorOutput(#CanvasTest))
VectorFont(FontID(#VFont_01),20)
T$ = ~"EscapeString\t\tTab test"
VectorSourceColor($FF0000FF)
MovePathCursor(10,10)
DrawVectorText(T$)
MovePathCursor(10,50)
T$ + ~"\n" + T$
DrawVectorParagraph(T$,200,72)
StopVectorDrawing()
Else
MessageRequester("ERROR!","Cannot invoke Vector Drawing")
EndIf
EndProcedure
XML$ = "<dialogs>"+
" <window id='#WinMain' name='CanvasTest' text='CanvasTest' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered |"+
" #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <canvas id='#CanvasTest' height='250' width='250' />"+
" </window>"+
"</dialogs>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "CanvasTest")
SetUp()
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf