Here is a little code showing how to color the text in an EditorGadget. Please don't ask how to color the whole background of the Gadget: I don't know it, either. Unfortunataly I didn't found something about this. Bur this is still a nice effect I think ...

Code: Select all
; Coded by Christian
;
; Coloring an EditorGadget
Dim color.GdkColor(3) ; Text Color
color(0)\red = 65535
color(0)\blue = 0
color(0)\green = 0
color(1)\red = 0
color(1)\blue = 65535
color(1)\green = 0
color(2)\red = 0 : color(3)\red = 0 ; Fore- and Background
color(2)\blue = 0 : color(3)\blue = 25000
color(2)\green = 65535 : color(3)\green = 0
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Programmcode
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MWHnd.l = OpenWindow(0, 0, 0, 500, 500, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Colored EditorGadget")
If MWHnd <> 0
; -- GadgetList
If CreateGadgetList(MWHnd)
edit.l = EditorGadget(0, 0, 0, 500, 500)
gtk_text_insert_(edit.l, 0, color(0), 0, "Here is red text!"+Chr(10), -1)
gtk_text_insert_(edit.l, 0, color(1), 0, "But perhaps you like blue a bit more?"+Chr(10), -1)
gtk_text_insert_(edit.l, 0, color(2), color(3), "Or here green with a nice background?", -1)
EndIf
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_EventCloseWindow
quit = 1
EndSelect
Until quit = 1
End