On May 2, 2011, at 10:51 AM, David Chisnall wrote:
> Shiny!
>
> On 1 May 2011, at 14:29, Mathieu Suen wrote:
>
>> drawRect: rect [
>> "d or f depending on 64 or 32 bit arch (should be simpler using
>> Objc.NSRect typeStr...)"
>> <objcTypeStr:'v@:{_NSRect={_NSPoint=dd}{_NSSize=dd}}'>
>
> I'm not certain why this is needed. This information can be obtained by
> runtime introspection (that's what LanguageKit does) - you can just grab the
> type encoding from the superclass method and parse it. This includes the
> argument types, so there's no need to specify it directly.
Yes sure but one could create a method that does not exist in the super class.
But I agree I should provide both pragma. One pragma with no parameter that
would lookup in the super class and one pragma with a parameter.
>
>
>> nsRect := Objc.NSRect gcOriginX: 0.0
>> y: 0.0
>> width: 100.0
>> height: 100.0.
>
>
> You might be interested in the SmalltalkSupport library in LanguageKit.
> This, among other things, provides a category on NSValue that lets you create
> objects that box the common primitive types.
In fact NSRect is a subclass of a CStruct from gnu-smalltalk that provide the
boxing/unboxing from C.
Here I am just reusing the feature from gnu-smalltalk.
Anyway I will have look at NSValue.
Thanks a lot for all this feedback, I greatly appreciate them :)
>
> David
>
> -- Send from my Jacquard Loom
>
>
> _______________________________________________
> Etoile-discuss mailing list
> [email protected]
> https://mail.gna.org/listinfo/etoile-discuss
Mathieu
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss