With my Win10 & PB 6.11 x64, the text is red:



Code: Select all
; https://www.purebasic.fr/english/viewtopic.php?p=624896#p624896
InitScintilla("Scintilla.dll")
OpenWindow(0, 0, 0, 500, 300, "Essais Scintilla", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
ScintillaGadget(1, 0, 0, WindowWidth(0), WindowHeight(0) - 30, 0)
*t = UTF8("Courier")
ScintillaSendMessage(1, #SCI_STYLESETFONT, #STYLE_DEFAULT, *t) ;
FreeMemory(*t)
ScintillaSendMessage(1, #SCI_STYLESETSIZE, #STYLE_DEFAULT, 15)
ScintillaSendMessage(1, #SCI_STYLECLEARALL)
For i = 1 To 100
Ascii = Random(125, 32)
If Sentence = 40
Text$ + #CRLF$
Sentence = 0
Else
Sentence + 1
EndIf
Text$ + Chr(Ascii)
Next
Text$ + "Coucou"
For i = 1 To 200
Ascii = Random(125, 32)
If Sentence = 40
Text$ + #CRLF$
Sentence = 0
Else
Sentence + 1
EndIf
Text$ + Chr(Ascii)
Next
*t = UTF8(Text$)
ScintillaSendMessage(1, #SCI_SETTEXT, 0, *t)
FreeMemory(*t)
#StyleRouge = 1
#StyleBleu = 2
ScintillaSendMessage(1, #SCI_STYLESETFORE, #StyleRouge, #Red)
ScintillaSendMessage(1, #SCI_STYLESETFORE, #StyleBleu, #Blue)
; <== This is a dirty hack ==>
Dim MyColor(1300)
MyColor(1) = #Red
MyColor(2) = #Blue
; Creation des STYLES
ScintillaSendMessage(1, #SCI_STYLESETFORE, #StyleRouge, MyColor(1))
ScintillaSendMessage(1, #SCI_STYLESETFORE, #StyleBleu, MyColor(2))
StartStyling = 5
SizeStyling = 10
ScintillaSendMessage(1, #SCI_STYLESETITALIC, #StyleRouge, #True)
ScintillaSendMessage(1, #SCI_STYLESETBOLD, #StyleRouge, #True)
ScintillaSendMessage(1, #SCI_STARTSTYLING, StartStyling, #StyleRouge) ; Color is the index of the Array (see Dim Mycolor()
ScintillaSendMessage(1, #SCI_SETSTYLING, SizeStyling, #StyleRouge) ;
StartStyling = 30
SizeStyling = 10
ScintillaSendMessage(1, #SCI_STYLESETITALIC, #StyleRouge, #False)
ScintillaSendMessage(1, #SCI_STYLESETBOLD, #StyleRouge, #False)
ScintillaSendMessage(1, #SCI_STARTSTYLING, StartStyling, #StyleRouge) ; Color is the index of the Array (see Dim Mycolor()
ScintillaSendMessage(1, #SCI_SETSTYLING, SizeStyling, #StyleRouge) ;
StartStyling = 60
SizeStyling = 10
ScintillaSendMessage(1, #SCI_STYLESETITALIC, #StyleBleu, #False)
ScintillaSendMessage(1, #SCI_STYLESETBOLD, #StyleBleu, #False)
ScintillaSendMessage(1, #SCI_STARTSTYLING, StartStyling, #StyleBleu) ; Color is the index of the Array (see Dim Mycolor()
ScintillaSendMessage(1, #SCI_SETSTYLING, SizeStyling, #StyleBleu) ;
StartStyling = 110
SizeStyling = 10
ScintillaSendMessage(1, #SCI_STYLESETITALIC, #StyleBleu, #True)
ScintillaSendMessage(1, #SCI_STYLESETBOLD, #StyleBleu, #True)
ScintillaSendMessage(1, #SCI_STARTSTYLING, StartStyling, #StyleBleu) ; Color is the index of the Array (see Dim Mycolor()
ScintillaSendMessage(1, #SCI_SETSTYLING, SizeStyling, #StyleBleu) ;
Repeat
Evenement = WaitWindowEvent()
Until Evenement = #PB_Event_CloseWindow
The happiness is a road...

The happiness is a road...And adapt your code to more recent PB version would be so difficult or complicated?Kwai chang caine wrote: The problem is i'm affraid to think that is also "simple" to change the version, than use the library![]()
