Re: GadgetItemData bug

Just starting out? Need help? Post your questions and find answers here.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: GadgetItemData bug

Post 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)
Image Image
Denimus
User
User
Posts: 17
Joined: Sun Feb 10, 2013 1:04 pm
Location: Miami-Dade

Re: GadgetItemData bug

Post 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...
User avatar
NicTheQuick
Addict
Addict
Posts: 1523
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: GadgetItemData bug

Post by NicTheQuick »

Am I missing something here? Why is that thread in the bug section?

Pleas read: viewtopic.php?t=4701
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
mk-soft
Always Here
Always Here
Posts: 6252
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GadgetItemData bug

Post by mk-soft »

I thing the first bug request is deleted ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
NicTheQuick
Addict
Addict
Posts: 1523
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: GadgetItemData bug

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: GadgetItemData bug

Post 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.
Image Image
Little John
Addict
Addict
Posts: 4791
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: GadgetItemData bug

Post 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.
Post Reply