ListIconGadget with specific font change row height randomly

Just starting out? Need help? Post your questions and find answers here.
User avatar
lgb-this
User
User
Posts: 34
Joined: Sat Aug 30, 2014 9:00 pm
Location: Switzerland
Contact:

ListIconGadget with specific font change row height randomly

Post 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)
BarryG
Addict
Addict
Posts: 4180
Joined: Thu Apr 18, 2019 8:17 am

Re: ListIconGadget with specific font change row height randomly

Post 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.
User avatar
lgb-this
User
User
Posts: 34
Joined: Sat Aug 30, 2014 9:00 pm
Location: Switzerland
Contact:

Re: ListIconGadget with specific font change row height randomly

Post by lgb-this »

Thanks for the hint.
Post Reply