Page 1 of 1

PB 6.10 b8 - Font line height much taller

Posted: Thu Mar 28, 2024 11:13 pm
by WilliamL
The ListViewGadget line height is much taller starting with 6.10beta8 (thru 10) than it was in 6.10b7 and before in my programs (seen in 2 programs).

Left is 6.10beta 7 and on the right is LTS6.10. Same program using Geneva 12 in a ListViewGadget.

Oddly, if I run the ListViewGadget Help example I get the tall spacing in any version.

Image

Re: PB 6.10 b8 - Font line height much taller

Posted: Wed Apr 03, 2024 9:41 pm
by WilliamL
I played with the help example and tried to get the two different line heights.

This example shows both narrow and tall line spaces using beta 7 (not 8-10 tall both ways).

Code: Select all

#geneva12=1 ; only in beta 7 and before!
LoadFont(#geneva12,"Geneva",12)
If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListViewGadget(0, 10, 10, 250, 120)
    For a = 1 To 12
      AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview") ; define listview content
    Next
    SetGadgetFont(0,FontID(#geneva12)) ; take this out and get tall lines
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
This doesn't explain why my old code went from narrow to tall lines but I'm starting to wonder if it should have been tall all along. If that is the case then SetGadgetFont is doing something odd but I really liked the small line height.

Re: PB 6.10 b8 - Font line height much taller

Posted: Wed Apr 03, 2024 11:18 pm
by mk-soft
In Beta 8, the row height was much too small and has been adjusted.
If this is now too large for you, you can adjust it yourself.

Code: Select all


#geneva12=1 ; only in beta 7 and before!

Global rowHeight.cgfloat

LoadFont(#geneva12,"Geneva",12)

If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListViewGadget(0, 10, 10, 250, 120)
    For a = 1 To 12
      AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview") ; define listview content
    Next
    
      CocoaMessage(@rowHeight, GadgetID(0), "rowHeight")
    Debug "Default: " + rowHeight
    
    SetGadgetFont(0,FontID(#geneva12)) ; take this out and get tall lines
    
    CocoaMessage(@rowHeight, GadgetID(0), "rowHeight")
    Debug "Geneva: " + rowHeight
    
    rowHeight = 20.0
    CocoaMessage(0, GadgetID(0), "setRowHeight:@", @rowHeight)
    
    CocoaMessage(@rowHeight, GadgetID(0), "rowHeight")
    Debug "My rowHeight: " + rowHeight
    
    
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Re: PB 6.10 b8 - Font line height much taller

Posted: Thu Apr 04, 2024 4:54 pm
by WilliamL
Thanks mk-soft

That's a huge relief.

I liked the spacing and it will be easy to fix with your suggestion.

Re: PB 6.10 b8 - Font line height much taller

Posted: Tue Apr 09, 2024 9:17 pm
by WilliamL
I've been setting my own heights of all my fonts and I'm wondering if there is a command to tell what the default (or my) line spacing is after the ListView gadget is created?