This Procedure let's you include a RTF file with IncludeBinary, and then
directly catch it, and load it into an EditorGadget.
Usefull if you want to make a static Text box, with nicely formated text for
example.
Code: Select all
; Usage:
; CatchRTF(#EditorGadget, MemoryAddress)
;
; Streams a RTF file included by IncludeBinary directly into an EditorGadget.
;
;
Procedure.l CatchRTF_Callback(dwCookie.l, pbBuff.l, cb.l, *pcb.LONG)
Shared CatchRTF_Address.l
CopyMemory(CatchRTF_Address, pbBuff, cb)
CatchRTF_Address + cb
*pcb\l = cb
ProcedureReturn 0
EndProcedure
;
Procedure CatchRTF(Gadget.l, MemoryAddress.l)
Shared CatchRTF_Address.l
CatchRTF_Address = MemoryAddress
stream.EDITSTREAM\pfnCallback = @CatchRTF_Callback()
SendMessage_(GadgetID(Gadget), #EM_STREAMIN, #SF_RTF, @stream)
EndProcedure