Need workaround SetGadgetItemColor with ListViewGadget
Posted: Thu Feb 07, 2013 11:16 am
I found the workaround for the ListIconGadget, but is there a similar for the ListViewGadget?
Thanks in advance

Thanks in advance

http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
OpenWindow(0,100,100,640,480,"Test")
ListViewGadget(0,0,0,640,480)
For i=1 To 10
AddGadgetItem(0,-1,"Test"+Str(i))
Next
SetGadgetItemColor(0,2,#PB_Gadget_FrontColor,RGB(Random(255), Random(255), Random(255)),0)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Code: Select all
OpenWindow(0,100,100,640,480,"Test")
ListViewGadget(0,0,0,640,480)
CocoaMessage(0, GadgetID(0), "setUsesAlternatingRowBackgroundColors:", #YES)
For i=1 To 10
AddGadgetItem(0,-1,"Test"+Str(i))
Next
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
You may try this workaround which allows you to change text and back color of single rows.ozak wrote:No workaround using CocoaMessage? I tried searching the Apple docs but no luck so far