[Mono-osx] [MonoMac] NSSearchField Sample and diffs

kjpou kjpou at pt.lu
Thu Dec 2 03:32:04 EST 2010


Here is the new diff.

Kenneth

On 12/2/10 8:04 AM, kjpou wrote:
> Hello everyone.
>
> Did not read thoroughly the documentation so my implementation of 
> NSControl is wrong and will have to be changed as per the Apple 
> Documentation:
>
> An NSControl object posts the following notifications to interested 
> observers and its delegate. Note that although the NSControl class 
> defines delegate methods, it does not itself have a delegate. Any 
> subclass that uses these methods must have a delegate and the methods 
> to get and set it.
>
> Will send a new update later.
>
> Sorry about that
>
> Kenneth
>
>
> On 12/2/10 4:52 AM, kjpou wrote:
>> Hello everyone
>>
>> Here is another sample for NSSearchField implementation.  I thought I 
>> would do an easy one but that quickly vanished.
>>
>> After some head banging, some reading and a lot of cussing I finally 
>> got it working.  Had to add some modification to the 
>> NSTextFieldDelegate and added the delegate implementation to the 
>> NSControl control.
>>
>> Now banging out one of these will take at most thirty minutes instead 
>> of a couple of days.
>>
>> There is still one problem that I never worked out and instead had to 
>> change the message signature from:
>>
>>         [Export 
>> ("control:textView:completions:forPartialWordRange:indexOfSelectedItem:"), 
>> EventArgs ("NSControlTextFilter"), DefaultValue (null)]
>>         string [] FilterCompletions (NSControl control, NSTextView 
>> textView, string [] words, NSRange charRange, int index);
>>
>> To:
>>
>>         [Export 
>> ("control:textView:completions:forPartialWordRange:indexOfSelectedItem:"), 
>> EventArgs ("NSControlTextFilter"), DefaultValue (null)]
>>         NSArray FilterCompletions (NSControl control, NSTextView 
>> textView, NSArray words, NSRange charRange, int index) ;
>>
>> If not modified this way there are messages about adding a MarshalAs 
>> and am not quite sure what or why that was.  I did some grepping and 
>> found a few of those in the source code where the methods are 
>> commented out.
>>
>> Anyway without further ado you will find the Mono solution attached 
>> as well as the diff to get it to work.
>>
>> Have a good day
>>
>> Kenneth
>>
>>
>>
>> _______________________________________________
>> Mono-osx mailing list
>> Mono-osx at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101202/fad0cf11/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NSSearchField.diff
Url: http://lists.ximian.com/pipermail/mono-osx/attachments/20101202/fad0cf11/attachment.pl 


More information about the Mono-osx mailing list