[futurebasic] Re: [FB] Text from resources

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2001 : Group Archive : Group : All Groups

From: Heather Donahue <heatherd@...>
Date: Wed, 31 Oct 2001 01:56:34 -0800
At 7:11 PM +1000 on 10/31/01, David Cottrell wrote:


>Can someone tell me how to get text from a resource and put the 
>styled text into a appearance compliant control?
>
>eg I get the text handle with:
>
>resHndl = FN GETRESOURCE(_"pG3t",gObjResID)
>
>and set the controls with:
>
>btnH = fn NewControl(windowPtr,gObjT,"", _zTrue, 0, 0, 0, 
>_kControlStaticTextProc, 0 )
>err = fn SetControlData(btnH, 0, _kControlStaticTextTextTag, ????, ????)
>
>but what goes in where the ???? are?
>
>Also what about style data? Do I need to use:
>
>_kControlStaticTextStyleTag ?

the first ???? in SetControlData is the size of the data you want to 
set.  It's a type LONG.  The next ???? is a pointer to the data 
buffer.

I don't think that a control can take styled text.  You can set the 
font, size and style using _kControlStaticTextStyleTag (also called 
_kControlFontStyleTag) but it is applied to all the text.

The resource pG3t is a ZTXT resource type so you won't be able to 
pass it directly.  You might want to just store the text as a TEXT 
resource.  If not you'll have to separate the data out.