NSVisualEffectView - fuzzy Text

Hi,

I have made an NSVisualTextView but I’d like to place some text on it using a simple label but
the text doesn’t appear to be crips anymore. I’ve googled it but couldn’t find that kind of issues.
What I am doing wrong? Any suggestions ?

You probably need to create a label subclass that returns True for the allowsVibrancy property.

Do you know that for sure ? Have you worked with NSVisualEffectView too ?

Not for sure. I just experienced this myself and, as everything else is fine, came to the conclusion it probably would be the reason. But didn’t have time yet to try.

Sorry mate but I don’t need a guesswork or a sort of direction. I have seen Sam got
subclassed the TextField in his AppWrapper (but encrypted it).
I did also some modifications to the Label and the result is a better. However, I actually want to get the same results as in Finder or the original quality from the Label. I don’t understand the reasons
for a fuzzy text if it’s placed over an NSView

I meant the RetinaKit:

The best result I get using a TextField instead of a Label :
declare sub setEditable lib CocoaLib selector “setEditable:” (id as ptr, value as Boolean)
declare sub setSelectable lib CocoaLib selector “setSelectable:” (id as ptr, value as Boolean)
declare sub setBackgroundStyle lib CocoaLib selector “setBackgroundStyle:” (obj as ptr, value as integer)
declare sub setBackgroundColor lib CocoaLib selector “setBackgroundColor:” (obj as ptr, col as ptr)
declare sub setDrawsBackground lib CocoaLib selector “setDrawsBackground:” (obj as ptr, value as boolean)
declare function cell lib CocoaLib selector “cell” (obj as ptr) as ptr
declare function clearColor lib CocoaLib selector “clearColor” (obj as ptr) as ptr
declare sub setWraps lib CocoaLib selector “setWraps:” ( id as Ptr, inValue as boolean )
declare sub setTruncatesLastVisibleLine lib CocoaLib selector “setTruncatesLastVisibleLine:” ( id as Ptr, flag as Boolean)

/* optional
setEditable(ptr(me.Handle), false)
setSelectable(ptr(me.Handle), false)
/
setBackgroundColor(ptr(me.Handle),clearColor(NSClassFromString(“NSColor”)))
setBackgroundStyle(cell(ptr(me.Handle)),2)
/
optional
setWraps(cell(ptr(me.handle)), true)
setTruncatesLastVisibleLine(cell(ptr(me.handle)), true)
*/

solved. It was OK before but setWantsLayet solved it.
declare sub setWantsLayer lib CocoaLib selector “setWantsLayer:” (ob_id As Ptr, b as Boolean)
declare sub setEditable lib CocoaLib selector “setEditable:” (id as ptr, value as Boolean)
declare sub setSelectable lib CocoaLib selector “setSelectable:” (id as ptr, value as Boolean)
declare sub setBackgroundStyle lib CocoaLib selector “setBackgroundStyle:” (obj as ptr, value as integer)
declare sub setBackgroundColor lib CocoaLib selector “setBackgroundColor:” (obj as ptr, col as ptr)
declare sub setDrawsBackground lib CocoaLib selector “setDrawsBackground:” (obj as ptr, value as boolean)
declare function cell lib CocoaLib selector “cell” (obj as ptr) as ptr
declare function clearColor lib CocoaLib selector “clearColor” (obj as ptr) as ptr
declare sub setWraps lib CocoaLib selector “setWraps:” ( id as Ptr, inValue as boolean )
declare sub setTruncatesLastVisibleLine lib CocoaLib selector “setTruncatesLastVisibleLine:” ( id as Ptr, flag as Boolean)

/* optional
setEditable(ptr(me.Handle), false)
setSelectable(ptr(me.Handle), false)
setWraps(cell(ptr(me.handle)), true)
setTruncatesLastVisibleLine(cell(ptr(me.handle)), true)
setBackgroundStyle(cell(ptr(me.Handle)),2)
*/

setBackgroundColor(ptr(me.Handle),clearColor(NSClassFromString(“NSColor”)))
setWantsLayer(ptr(me.Handle), true)

Make Sure Border = false

Hi Rob, this is included as part of the source code to the Retina Kit, it’s encrypted in the demo but when you purchase you get the unlocked source code.

Vibrancy isn’t required, but you should use it, as it will have the correct color no matter what NSVisualEffectView.material is used beneath.

And you know what, Rob? I realized that too when I experimented with Vibrancy but forgot it. Thanks for reminding me! :smiley: