Redraw artifacts

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

Redraw artifacts

Post by WilliamL »

I just discovered that in one of my programs that a routine that worked in 5.73 causes black artifacts when a screen is redrawn. I get anything from several lines in a ListViewGadget having splotchy areas to whole lines with splotches that cover most of the screen. The dark areas are very random in shape and position on page.

I will try to get some code to replicate the problem in a little while.

The code is fine in 5.73 LTS and broken 6.0LTS on the M1 version and the x64 version both.
MacBook Pro-M1 (2021), Sonoma 14.3.1 (CLT 15.3), PB 6.10b7 M1
WilliamL
Addict
Addict
Posts: 1214
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: [6.0LTS]-redraw artifacts

Post by WilliamL »

Ok, I find that, in my program, that the lines are too long and are over writing the visible text. I don't know why I can't reproduce it with the ListView example from Help but here is some code that has the problem (at least on my computer ;-) .

Code: Select all

#showHDlistwnd=1
#maxfiles=100
#showHDlistefid=1

#geneva10=1
LoadFont(#geneva10,"Geneva",10)
;#geneva12=2
;LoadFont(#geneva12,"Geneva",12)

Global totitems=99
Global Dim DirList.s(#maxfiles,3)
ExamineDesktops()

Procedure ShowHDList()
    Define z, lne,h=500,w=400
    
    If OpenWindow(#showHDlistwnd,0,0,w,h,"Show HD List: ", #PB_Window_SystemMenu | #PB_Window_WindowCentered | #PB_Window_SizeGadget)
        SetGadgetFont(#PB_Default, FontID(#geneva10))
        ;SetGadgetFont(#PB_Default, FontID(#geneva12))
        
        ListViewGadget(#showHDlistefid,0,0,w,h)
        lne=0
        For z=1 To totitems
            lne=64+z : If lne>154 : lne-64 : EndIf
            DirList(z,1)=Chr(Lne)+" this is a long line that goes past the end of the screen"+" this is a long line that goes past the end of the screen"+" this is a long line that goes past the end of the screen"
            dirlist(z,2)="Description"
            dirlist(z,3)="Size"
            AddGadgetItem(#showHDlistefid,-1,Chr(lne)+". "+DirList(z,1)+" in HD List)")
            AddGadgetItem(#showHDlistefid,-1,"    "+DirList(z,2))
            AddGadgetItem(#showHDlistefid,-1,"    "+DirList(z,3))
        Next
    EndIf
EndProcedure
 
Procedure DoShowHDList(event)
    Define id,z
    Select event
    Case #PB_Event_CloseWindow
        End
    EndSelect
EndProcedure
    
ShowHDList()

; loop
Repeat
    event = WaitWindowEvent()
    Select event
    Case #PB_Event_CloseWindow
        End
    EndSelect
ForEver
MacBook Pro-M1 (2021), Sonoma 14.3.1 (CLT 15.3), PB 6.10b7 M1
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [6.0LTS]-redraw artifacts

Post by mk-soft »

PB Now uses its own drawing for the ListViewGadget and ListIconGadget items (rows).
Doesn't seem to get along with the font 'Geneva'. With another font it works
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
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [6.0LTS]-redraw artifacts

Post by Fred »

We use [ParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; do draw the string and it seems to fail with this specific font. Probably an OS X issue.
Post Reply