[Mono-list] Cocoa-Sharp and Growl
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>.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list