PB 6.10 b8 - Font line height much taller

Mac OSX specific forum
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

PB 6.10 b8 - Font line height much taller

Post 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
Last edited by WilliamL on Wed Apr 03, 2024 10:03 pm, edited 1 time in total.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: PB 6.10 b8 - Font line height much taller

Post 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.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
User avatar
mk-soft
Always Here
Always Here
Posts: 6206
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB 6.10 b8 - Font line height much taller

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: PB 6.10 b8 - Font line height much taller

Post by WilliamL »

Thanks mk-soft

That's a huge relief.

I liked the spacing and it will be easy to fix with your suggestion.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: PB 6.10 b8 - Font line height much taller

Post 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?
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Post Reply