ListIconGadget and SetGadgetItemColor
Posted: Tue Jul 02, 2024 7:56 pm
Good morning,
In this little example, when I right click on a line, I want the background to turn red immediately.
However, the color remains blue and it is only when I select another line that the background becomes red.
Is there a trick to make the background turn red immediately when I right click on it?
thank you
In this little example, when I right click on a line, I want the background to turn red immediately.
However, the color remains blue and it is only when I select another line that the background becomes red.
Is there a trick to make the background turn red immediately when I right click on it?
thank you
Code: Select all
OpenWindow(0, 0, 0, 600, 400, "Test")
ListIconGadget(0, 0, 0, 400, 200, "Exemple", 150, #PB_ListIcon_FullRowSelect)
AddGadgetItem (0,-1,"aaaaaa")
AddGadgetItem (0,-1,"bbbbbb")
AddGadgetItem (0,-1,"cccccc")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_RightClick
r = GetGadgetState(0)
If r > -1
SetGadgetItemColor(0, r , #PB_Gadget_BackColor , #Red, #PB_All)
EndIf
EndSelect
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow