Page 1 of 1
Tahoe and text rendering
Posted: Sun Aug 24, 2025 8:13 pm
by mrbungle
macOS Tahoe changed how some UI gadgets render. You may have to force macOS to redraw the element using something like:
Code: Select all
view = GadgetID(#GadgetID)
CocoaMessage(0, view, "setNeedsLayout:", #YES)
CocoaMessage(0, view, "layoutIfNeeded")
CocoaMessage(0, view, "setNeedsDisplay:", #YES)
Re: Tahoe and text rendering
Posted: Mon Aug 25, 2025 1:17 pm
by Fred
Which gadget are affected ? It looks like a bug IMHO
Re: Tahoe and text rendering
Posted: Mon Aug 25, 2025 2:17 pm
by mrbungle
It was a text gadget. I used text gadgets and a scroll area gadget to display content organized into pages. There were buttons in the UI as well. On macOS versions 15 and lower, clicking the scroll bar worked as expected and the content paged. On macOS Tahoe betas, it did not update and page the UI contents the UI until I forced a redraw.
Re: Tahoe and text rendering
Posted: Mon Aug 25, 2025 2:18 pm
by Fred
Do you have a small sample ?
Re: Tahoe and text rendering
Posted: Mon Aug 25, 2025 2:20 pm
by mrbungle
I had seen some scattered feedback searching on the web that other developers were experiencing similar issues with redraws. It could be an Apple bug, or an undocumented change in behavior.
Re: Tahoe and text rendering
Posted: Mon Aug 25, 2025 2:26 pm
by mrbungle
Not sure if this is helpful:
I create the original gadgets with a separate procedure (as a template) and then populate them with a different one using setgadgettext(). Because each row in a page has gadgets to control things like editing or deleting items and I employ paging for potentially hundreds of entries, I hide gadgets not in the current page view. This arrangement worked flawlessly on macOS 13-15 but failed to update on Tahoe. Once I added the code to force a UI redraw, it worked fine. I added other code like forcing a redraw and hiding and unhiding gadgets, but nothing worked. Only forcing a re-draw did.
Code: Select all
If Not IsGadget(#Gadget_Base_Category + index)
ButtonGadget(#Gadget_Base_Category + index, 564 - categoryWidth, yPos + 27, categoryWidth, 20, category)
CocoaMessage(0, GadgetID(#Gadget_Base_Category + index), "setBezelStyle:", 13)
SetGadgetFont(#Gadget_Base_Category + index, LoadFont(#GadgetFont, #DisplayFont$, 10))
Else
SetGadgetText(#Gadget_Base_Category + index, category)
ResizeGadget(#Gadget_Base_Category + index, 564 - categoryWidth, yPos + 27, categoryWidth, 20)
EndIf
HideGadget(#Gadget_Base_Category + index, #True)
HideGadget(#Gadget_Base_Category + index, #False)
; force icon
view = GadgetID(#Gadget_Base_Category + index)
CocoaMessage(0, view, "setNeedsLayout:", #YES)
CocoaMessage(0, view, "layoutIfNeeded")
CocoaMessage(0, view, "setNeedsDisplay:", #YES)
If Not IsGadget(#Gadget_Base_Edit + index)
ButtonGadget(#Gadget_Base_Edit + index, 576, yPos + 6, 50, 40, "Edit")
EndIf
HideGadget(#Gadget_Base_Edit + index, #False)
Re: Tahoe and text rendering
Posted: Mon Aug 25, 2025 2:29 pm
by mrbungle
The gadgets will appear. The issue is they will not update with new values for setgadgettext() once you page to a new screen.