Page 1 of 1

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 3:23 am
by Paul
[Original posting is missing]

You coded it incorrectly...

AddGadgetItem(3,i,"test") ;<---- change 0 to i

Code: Select all

If OpenWindow(0, 0, 0, 280, 250, "GadgetItemData bug", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ListViewGadget(3, 10, 40, 260, 200)
  For i = 0 To 2
    AddGadgetItem(3,i,"test") : SetGadgetItemData(3,i,404)
    Debug "1.  "+GetGadgetItemData(3, i) ; values are here
  Next
  For i = 0 To 2
    Debug "2.  "+GetGadgetItemData(3, i) ; now the values are lost
  Next
EndIf

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 5:03 am
by Denimus
Oh my, Thx... The "to add the item at the start, use an index of 0" messed me up, i made this out of huge code chunk...

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 1:16 pm
by NicTheQuick
Am I missing something here? Why is that thread in the bug section?

Pleas read: viewtopic.php?t=4701

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 1:18 pm
by mk-soft
I thing the first bug request is deleted ...

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 1:47 pm
by NicTheQuick
Because that bug does not exist on Linux I guess you have to give the gadget time to initialize its items properly by using a simple

Code: Select all

While WindowEvent(): Wend
before the second For loop.

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 3:17 pm
by Paul
Just a note, this thread is missing the original post :shock:

I am not the original poster.
I responded to the original post showing how to correct the problem.

Re: GadgetItemData bug

Posted: Wed Nov 02, 2022 8:11 pm
by Little John
Paul wrote: Wed Nov 02, 2022 3:17 pm Just a note, this thread is missing the original post :shock:

I am not the original poster.
I responded to the original post showing how to correct the problem.
And the original post was not a bug report at all, but it was a coding question.