Page 1 of 1
ListIconGadget text layout
Posted: Thu Feb 05, 2026 6:25 pm
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 ?
Re: ListIconGadget text layout
Posted: Thu Feb 05, 2026 7:51 pm
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.
Re: ListIconGadget text layout
Posted: Fri Feb 06, 2026 12:59 pm
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.
Re: ListIconGadget text layout
Posted: Mon Feb 09, 2026 7:30 am
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.
Re: ListIconGadget text layout
Posted: Mon Feb 09, 2026 8:50 am
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
Re: ListIconGadget text layout
Posted: Mon Feb 09, 2026 10:54 am
by Shardik
KianV wrote:
I am working cross-platform, but mainly on Linux.
Help for ListIconGadget wrote:
- SetGadgetAttribute() with the following attribute:
#PB_ListIcon_DisplayMode : Changes the display of the gadget (Windows only).