On Jan 9, 2011, at 10:43 PM, Paolo Bonzini wrote:
> On Sun, Jan 9, 2011 at 19:50, Mathieu Suen <[email protected]> wrote:
>> On Jan 9, 2011, at 6:14 PM, Paolo Bonzini wrote:
>>
>>> No, Smaltalk objects are not automatically converted to instances from
>>> the CObject hierarchy.
>>
>> Could it be interesting to have message like asCUChar, asCInt...?
>> This could avoid writing too mush parenthesis for example:
>> aCObject at: 1 put: 230 asCUChar.
>
> I don't think this would be used very often. Your example would not
> be equivalent to
>
> aCObject[1] = 230;
>
> but rather
>
> char *p = malloc (1);
> *p = 230;
> aCObject[1] = p;
I see yes.
So I have a question.
When I was playing with cairo I thought there was no other way than this to
write
on a surface:
cpngSurface := Cairo.CairoPngSurface on: 'test.png' extent: wi...@height.
data := Cairo.Cairo imageSurfaceGetData: cpngSurface cairoSurface.
..
data at: (i*4) + (j*stride) + 3 put: (CChar value: 255) type: CChar.
#imageSurfaceGetData: returns an instance of CObject.
How to make #imageSurfaceGetData: returns a CCharArray to do something like:
data at: (i*4) + (j*stride) + 3 put: 255 ?
Thanks
>
> Paolo
Mth
__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible
contre les messages non sollicités
http://mail.yahoo.fr Yahoo! Mail
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk