[Mono-list] Cocoa-Sharp and Growl

Alan McGovern alan.mcgovern at gmail.com
Tue Jul 17 17:47:32 EDT 2007


>
> The class I'm looking at currently is MutableDictionary. The Java API for
> Growl calls:
> noteDict.setObjectForKey(new Integer(1), GROWL_NOTIFICATION_STICKY);
>
> where noteDict is an NSMutableDictionary. The Java Cocoa bindings take
> Java Objects instead of Cocoa Objects, and with Integer inheriting Object,
> this works just fine. In cocoa-sharp, I have created a
> MutableDictionary.Set(Cocoa.Object,Cocoa.Object) method.
>
> With cocoa-sharp, I would have to either:
> 1) Have multiple definitions of Set which take Cocoa.Object and
> System.Int32 as keys
> 2) Create a Cocoa.Integer class, which doesn't seem right, although it
> might fit in with the Java API better
> 3) Have everything take System.Object instead of Cocoa.Object and pass in
> a System.Int32 object when needed.
>
> What exactly is the key? Is it *always* an integer? Is it *always* a
Cocoa.Object? Or can it be either? Can it be something other than an integer
or cocoa.object? If the key is always an integer, you could make your
mutable dictionary use a Dictionary<int, Cocoa.Object>.

Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070717/b74efcdb/attachment.html 


More information about the Mono-list mailing list