#if targetCocoa
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)
#endif
On a similar note - If you had a text area, and used that toolbar to create underlined and emboldened text, and then saved it out as a rtf file - what would happen when you tried to load it back in to a txt area? Would the formatting be retained, or are extra steps required?
Oh, I have that code, @Axel Schneider posted it on Xippets some time ago, its here:
make 2 Methods
Function myTextView(t as TextArea) As Ptr
#if TargetCocoa then
declare function documentView lib "Cocoa" selector "documentView" _
(obj_id as Integer) as Ptr
return documentView(t.Handle)
#endif
End Function
Sub ShowRuler(t as TextArea, value as Boolean)
#if targetCocoa
declare sub setRulerVisible lib "Cocoa" selector "setRulerVisible:" _
(obj_id as Ptr, value as Boolean)
setRulerVisible myTextView(t), value
#endif
End Sub
call it (Button)
If me.Caption = "Show Ruler" then
me.Caption = "Hide Ruler"
ShowRuler TextArea1, true
else
me.Caption = "Show Ruler"
ShowRuler TextArea1, False
End If