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

kjpou kjpou at pt.lu
Wed Dec 1 22:52:14 EST 2010


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: SearchField.zip
Type: application/zip
Size: 2088701 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20101202/8a54b156/attachment-0001.zip 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ReadMe.txt
Url: http://lists.ximian.com/pipermail/mono-osx/attachments/20101202/8a54b156/attachment-0001.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NSSearchField.diff
Url: http://lists.ximian.com/pipermail/mono-osx/attachments/20101202/8a54b156/attachment-0001.pl 


More information about the Mono-osx mailing list