Textedit like TextArea declare in 2021R3

I am trying to port to 2021R3 the declare that transforms TextArea into a TextEdit like editor.

Unfortunately, I get errors. I will appreciate some help.

Thank you in advance.

Currently:

declare function documentView lib "Cocoa" selector "documentView"(obj_id as Integer) as Ptr 
declare sub setUsesInspectorBar lib "Cocoa" selector "setUsesInspectorBar:" (obj_id as Ptr, value as Boolean)
setUsesInspectorBar(ptr(documentView(me.Handle)), true)

I get the following errors:

Window1.TextArea1.Opening, line 3
Parameter “obj_id” expects type Integer, but this is type Ptr.
setUsesInspectorBar(ptr(documentView(me.Handle)), true)

Window1.TextArea1.Opening, line 3
Type mismatch error. Expected Ptr, but got Int32
setUsesInspectorBar(ptr(documentView(me.Handle)), true)

Sorry, I was tired. Here is the source that works in the Opening event handler:

declare function documentView lib "Cocoa" selector "documentView"(obj_id as Integer) as Integer
declare sub setUsesInspectorBar lib "Cocoa" selector "setUsesInspectorBar:" (obj_id as Integer, value as Boolean)
setUsesInspectorBar(documentView(Integer(me.Handle)), true)
2 Likes