ListIconGadget column text
Posted: Sun Feb 18, 2018 1:43 am
Maybe this is common knowledge, but I only just realized it today.
For years now, I've been adding items to multiple ListIconGadget columns using "+#LF$+", which is a royal pain the butt to type, especially when my ListIconGadget has over 200 hard-coded items with descriptions in it.
It also meant whenever I accidentally deleted a quote, the text in the descriptions would convert to PureBasic syntax ("and" became "And", etc) which I then had to go and manually correct. Basically, it wasn't an enjoyable typing experience.
Today I found out I can do it more simply like this:
No quotes to accidentally delete, and no need to type a bunch of "+#LF$+" in there.
Hope this helps somebody else! Time to search/replace all my sources.
[Edit] Just watch out that if any column text contains a backslash (like C:\Test.txt) then you'll need to convert it to double-backslashes to stay valid (C:\\Test.txt).

For years now, I've been adding items to multiple ListIconGadget columns using "+#LF$+", which is a royal pain the butt to type, especially when my ListIconGadget has over 200 hard-coded items with descriptions in it.

It also meant whenever I accidentally deleted a quote, the text in the descriptions would convert to PureBasic syntax ("and" became "And", etc) which I then had to go and manually correct. Basically, it wasn't an enjoyable typing experience.
Code: Select all
AddGadgetItem(gad,-1,"Column1"+#LF$+"Column2"+#LF$+"Column3") ; Yuck!
Code: Select all
AddGadgetItem(gad,-1,~"Column1\nColumn2\nColumn3") ; Awesome!

Hope this helps somebody else! Time to search/replace all my sources.

[Edit] Just watch out that if any column text contains a backslash (like C:\Test.txt) then you'll need to convert it to double-backslashes to stay valid (C:\\Test.txt).