ListIconGadget text layout

Just starting out? Need help? Post your questions and find answers here.
KianV
User
User
Posts: 19
Joined: Thu Dec 26, 2019 3:31 pm

ListIconGadget text layout

Post by KianV »

I am trying to create a ListIconGadget containing images and their names.
The text is always positioned to the right of the image but I would like it to be underneath instead.
Decreasing the width of of the gadget to that of the image just makes the text disappear off the right hand side and putting the text on a different line pushes the text off to the right as if an image were there.
Is there any way that I can position the text where I want it ?
User avatar
mk-soft
Always Here
Always Here
Posts: 6579
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ListIconGadget text layout

Post by mk-soft »

This is the default of OS Specific ListIconGadgets in Report View.

It is a bit complex, but you can also create your own control as you wish with the CanvasGadget.
My Projects EventDesigner V3 / ThreadToGUI / OOP-BaseClass / Windows: Module ActiveScript
PB v3.30 / v5.75 - OS Mac Mini - VM Window Pro / Linux Ubuntu
Downloads on my OneDrive
Axolotl
Addict
Addict
Posts: 936
Joined: Wed Dec 31, 2008 3:36 pm

Re: ListIconGadget text layout

Post by Axolotl »

The ListIconGadget has 4 different display modes that can be changed from PB (see in Help)
For more changes to the styles you need some api function calls. Search for something like LVS_ALIGNLEFT.
If you are working with Windows, you can achieve full control by drawing the content yourself.
There are countless examples of owner draw possibilities in the forum.
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).
KianV
User
User
Posts: 19
Joined: Thu Dec 26, 2019 3:31 pm

Re: ListIconGadget text layout

Post by KianV »

Thanks for the replies.
I am working cross-platform, but mainly on Linux.
I suspected that I would have to create my own and it looks like I was right.
I shall hunt around for a similar example so that I hopefully don't have to reinvent the wheel.
BarryG
Addict
Addict
Posts: 4331
Joined: Thu Apr 18, 2019 8:17 am

Re: ListIconGadget text layout

Post by BarryG »

KianV wrote: Thu Feb 05, 2026 6:25 pm I am trying to create a ListIconGadget containing images and their names.
The text is always positioned to the right of the image but I would like it to be underneath instead.
See the bottom-right image in the Help manual: https://www.purebasic.com/documentation ... adget.html
User avatar
Shardik
Addict
Addict
Posts: 2079
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: ListIconGadget text layout

Post by Shardik »

KianV wrote: I am working cross-platform, but mainly on Linux.
BarryG wrote: See the bottom-right image in the Help manual: https://www.purebasic.com/documentation ... adget.html
Help for ListIconGadget wrote: - SetGadgetAttribute() with the following attribute:

#PB_ListIcon_DisplayMode : Changes the display of the gadget (Windows only).
Collection of cross-platform examples with API functions to extend PureBasic
Post Reply