Page 1 of 1

ListIconGadget with specific font change row height randomly

Posted: Thu Sep 11, 2025 6:54 am
by lgb-this
Platform: Windows 11
Purebasic: 6.04 and 6.30 beta 1 (64bit)
Compiler Option: Modern Themes on or off - same problem

The test code creates 2 ListIconGadgets with a specific font. The content of the rows is not 100% the same (text).

I can start this test code several times and the height of the rows is not always the same (see the following screenshots).

Image
Image
Image
Image

This behavior disappears when I deactivate the lines with 'SetGadgetFont'.

Code: Select all

Global s1.s
Global font_serif.q

font_serif = LoadFont(#PB_Any,"Microsoft Sans Serif",10)

If OpenWindow(0, 0, 0, 1000, 650, "xx", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  
  ListIconGadget(100,10,10,600,300,"A",30,#PB_ListIcon_FullRowSelect|#PB_ListIcon_GridLines)
  SetGadgetFont(100,font_serif)
  AddGadgetColumn(100,1,"B",65)

  For i = 1 To 17
    s1 = Str(i)
    s1 = s1 + #LF$ + "Fbbb"
    AddGadgetItem(100,-1,s1)
  Next i
    
  ListIconGadget(200,10,320,600,300,"A",30,#PB_ListIcon_FullRowSelect|#PB_ListIcon_GridLines)
  SetGadgetFont(200,font_serif)
  AddGadgetColumn(200,1,"B",65)

  For i = 1 To 17
    s1 = Str(i)
    s1 = s1 + #LF$ + "-"
    AddGadgetItem(200,-1,s1)
  Next i
    
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Quit = 1
    EndSelect    
  Until Quit = 1
EndIf

FreeFont(font_serif)
Any idea how to fix this ?


// Moved from "Bugs - Windows" to "The error is in front of the monitor" (Kiffi)

Re: ListIconGadget with specific font change row height randomly

Posted: Thu Sep 11, 2025 9:51 am
by BarryG
Not a bug. You didn't use FontID() like the manual says:

Code: Select all

SetGadgetFont(100,FontID(font_serif))
Please don't post in the Bug section unless you're 100% sure.

Re: ListIconGadget with specific font change row height randomly

Posted: Thu Sep 11, 2025 9:55 am
by lgb-this
Thanks for the hint.