[SOLVED] ListIconGadget was working fine now is blank/empty

Just starting out? Need help? Post your questions and find answers here.
Axolotl
Enthusiast
Enthusiast
Posts: 798
Joined: Wed Dec 31, 2008 3:36 pm

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Axolotl »

Randy Walker wrote: Sat Mar 15, 2025 11:10 am ..... Debug has been no help so far so my next idea is to try to export data from the list box to a file.
Not sure if that will help you finding the problem.
My (unqualified) suggestions for troubleshooting:
Set breakpoints on all “write commands” that describe the Listicon gadget. So on all SetGadgetXxxxxx lines.
If the header is not even displayed and you have not switched it off (with #LVS_NOCOLUMNHEADER), it looks like you write somewhere with Item == -1.
Sorry, but as always, without a code you're poking around in the fog (German Saying).
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Randy Walker »

Definitely something very screwy going on here. I put the following code in right after the loop that loads all the data into the list and my debug window filled up with record data, so the ListIcongadget is not empty -- it's just blank. Screwy!

Code: Select all

;   Debug "debugging list"
;   For e.i = 0 To recordCount.i - dummyRecord
;       a$ = GetGadgetItemText(#CustList_0,e,0)
;       For g.i = 1 To 7
;         a$ + GetGadgetItemText(#CustList_0,e,g)
;       Next g
;       Debug a$
;     Next e
#CustList_0 is the main listbox (the blank one), so the list box is definitely getting populated. This is the line I'm using to load up the list:

Code: Select all

    AddGadgetItem(#CustList_0,-1,a$)
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Randy Walker »

Axolotl wrote: Sat Mar 15, 2025 12:43 pm If the header is not even displayed and you have not switched it off (with #LVS_NOCOLUMNHEADER), it looks like you write somewhere with Item == -1.
Hi Axolotl,
I did not switch off the header, but I think you may be on to something. If you compare the two window captures I posted earlier it is plain to see the headers are not only blank -- they are missing. It's like it is totally disregarding instructions to create headers:

Code: Select all

    CustList0.i = ListIconGadget(#CustList_0, 5, 33, lastLook_wW.i - 7 - SM_CXtotal, lastLook_wH.i - 344 - SM_CYtotal, " Parent Co.", Col0_0, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection | #PB_ListIcon_GridLines | #PB_ListIcon_MultiSelect)
    SetGadgetColor(#CustList_0, #PB_Gadget_FrontColor, 0)
    AddGadgetColumn(#CustList_0, 1, " DBA Name", Col1_0)
    AddGadgetColumn(#CustList_0, 2, " Store ID", Col2_0)
    AddGadgetColumn(#CustList_0, 3, " Store Name", Col3_0)
    AddGadgetColumn(#CustList_0, 4, " Phone", Col4_0)
    AddGadgetColumn(#CustList_0, 5, " Support", Col5_0)
    AddGadgetColumn(#CustList_0, 6, " Ver", Col6_0)
    AddGadgetColumn(#CustList_0, 7, " OS", Col7_0)
    AddGadgetColumn(#CustList_0, 8, " IP Addrress", Col8_0)
This code has worked for years, and not made any changes in this area of the code.

Up until recently I only compiled using 32 bit PureBasic. Decided I should try compiling with 64 bit because they're going to be phasing out 32 bit processors and operating systems. Well, when I tested it in the 64 bit, it of course it overwrote the original file, So I'm wondering if maybe the 64 bit PureBasic caused some change in the source file. I don't know. I'm just grasping at straws here.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
infratec
Always Here
Always Here
Posts: 7575
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by infratec »

It makes no sense that you are showing some snippets.

Show us a fully working code which shows your error.
Then we can help.

My hint: Is your event loop correct and working? And do have only one event loop?
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Randy Walker »

infratec wrote: Sat Mar 15, 2025 10:02 pm It makes no sense that you are showing some snippets.

Show us a fully working code which shows your error.
Wish i could but, cannot, code is highly proprietary and will only run with a valid database file which contains very sensitive/private information.
BTW -- there is no "error" to show -- just the blank ListiconGadget.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
infratec
Always Here
Always Here
Posts: 7575
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by infratec »

Then reduce your code to a minimum where the 'blank' ListiconGadget is shown.

Fill it with 'bla bla bla' and remove the database stuff.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Randy Walker »

infratec wrote: Sat Mar 15, 2025 11:11 pm Then reduce your code to a minimum where the 'blank' ListiconGadget is shown.
Fill it with 'bla bla bla' and remove the database stuff.
Considered that,and even attempted to get started on that, but it is a lot of tedious work.
What I needed was a good clue, and "column headers" was the clue I needed. I looked at the dat file that holds column widths and saw a bunch of zeros. So I used default values from a new user DataSection to rebuild the dat file and Viola!!! ListIconGadget no longer blank. It's fixed -- problem solved. OHHh what a relief. Only thing bothering me now is why all those zeros in my dat file? That warrants further study for sure.

Thank you everyone for grinding gears on this for me.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Quin »

Glad you got it sorted Randy, as understandable as it was, it was frustrating that I couldn't just pop a snippet into the PB IDE, run it and help you figure out what was going wrong. That said though it's super gratifying when you figure out a super weird problem like this, so nice one!
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: ListIconGadget was working fine now is blank/empty [SOLVED -- NOT REALLY]

Post by Randy Walker »

Axolotl wrote: Sat Mar 15, 2025 12:43 pm If the header is not even displayed
MANY THANKS Axolotl!!! That was the clue I needed :D
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Post Reply