There is one old trick to avoid flickering of scintilla control (ScintillaGadget).
Just add to main window flag #WS_CLIPCHILDREN like this:
Code:
;scintilla control in editor app
#SCI_STYLESETFORE = 2051
#SCI_SETTEXT = 2181
Define win.i
win = 1
Define hsci.i
Define htext.s
htext = "This is a simple Scintilla with text..."
hsci=1
Define winstyle
winstyle = (#PB_Window_SystemMenu|#PB_Window_SizeGadget |#PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget|#WS_CLIPCHILDREN)
OpenWindow(win,100, 100, 640, 480, "Scintilla Control",winstyle )
If InitScintilla()
hsci=ScintillaGadget(win, 10, 52, 600, 400, #Null )
; front set color
SendMessage_(hsci, #SCI_STYLESETFORE, 0, RGB(0, 0, 0))
SendMessage_(hsci,#SCI_STYLESETBACK,32,RGB(249,248,218))
SendMessage_(hsci,#SCI_STYLECLEARALL, 0, 1)
scifontsize.i = 9
For i = 0 To 12
SendMessage_(hsci,#SCI_STYLESETFONT, i, "Courier New")
SendMessage_(hsci,#SCI_STYLESETSIZE, i, scifontsize)
Next i
;set number margin (For numnbers)
SendMessage_(hsci, #SCI_SETMARGINTYPEN, 0, #SC_MARGIN_NUMBER)
SendMessage_(hsci, #SCI_SETMARGINWIDTHN, 0, 46)
;set color of caret line
SendMessage_ (hsci,#SCI_SETCARETLINEBACK,RGB(225,225,245),0)
;Set caret line visible
SendMessage_ (hsci,#SCI_SETCARETLINEVISIBLE,1,0)
;test
SendMessage_(hsci, #SCI_SETTEXT, 100, htext)
EndIf
Repeat
wmsg=WaitWindowEvent()
Select wmsg
Case #WM_SIZE
winW = WindowWidth(win)
winH = WindowHeight(win)
ResizeGadget(1, 10, 52, (winW-20), (winH-64))
EndSelect
Until wmsg = #WM_CLOSE
And work fine without flickering
