Sieht aus wie ein echt dummer bug, ich kann garkeine Listviews mit SetGadgetItemText() verwenden, da immer For-Schleifen inkorrekt laufen und Items erstellt werden anstatt umbenannt zu werden.Hello,
I've found a big bug with SetGadgetItemText() in combination with a ListViewGadget().
The following code should count from 0 to 0 (for n = 0 to 0 because the number of items in the listview is 0) but it counts up to infinitely. The counting-variable "n" does not stop at the ending of the for loop and increases more and more.
Code: Alles auswählen
OpenWindow(0, 0, 0, 500, 500, #PB_Window_SystemMenu, "wij") CreateGadgetList(WindowID()) ListViewGadget(0, 0, 0, 400, 400) Debug "Items in Gadget: " + Str(CountGadgetItems(0)) For n = 0 To CountGadgetItems(0) SetGadgetItemText(0, n, "Inhalt", 0) Debug "counter: " + Str(n) Next n Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
And even with some items in the list before we make the for loop with SetGadgetIemText, the same bug appers:
(Here we first create 2 items so it should count from 0 to 2)Code: Alles auswählen
OpenWindow(0, 0, 0, 500, 500, #PB_Window_SystemMenu, "wij") CreateGadgetList(WindowID()) ListViewGadget(0, 0, 0, 400, 400) AddGadgetItem(0, -1, "item1") AddGadgetItem(0, -1, "item2") Debug "Items in Gadget: " + Str(CountGadgetItems(0)) For n = 0 To CountGadgetItems(0) SetGadgetItemText(0, n, "Inhalt", 0) Debug "counter: " + Str(n) Next n Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
And another pretty important question is, WHY is this command "SetGadgetItemText()" creating gadtet-items? Shouldn't it only change the text of items? But here it creates items and it disturbs for-loops and make them working wrong.
A bug which has to be fixed very soon I think, now you can't use SetGadgetItemText() with listviewgadgets without having bugs. (Strange that nobody before me recognized that).
I've tested the code with 3.92 and 3.90 for windows, different versions, same bug.
mfg.
Sunny