Re: Find panel
Re: Find panel
- Subject: Re: Find panel
- From: Ivan Myrvold <email@hidden>
- Date: Mon, 2 Aug 2004 08:00:47 +0200
More clues:
1. I write in a search word in NSSearchField ("hello")
2. I tabs into the NSTextView, and open the find panel. It is empty.
3. I click in the Mail.app and opens the find panel. Voila, it contains
"hello"
4. I click in my app again, and opens the find panel, and now it also
contains "hello"
If I now write in a new search word in my app, the find panel still
contains "hello". I have to go through Mail.app (or another Cocoa app)
to get t changed.
There must be another method call I am missing. Here is the whole
NSSearch field action method:
- (IBAction)searchAction:(id)sender {
if ([[sender stringValue] length] > 0) {
NSRange textRange = [[self consoleView] rangeOfString:[sender
stringValue]];
NSPasteboard *pb = [NSPasteboard pasteboardWithName:NSFindPboard];
[ocommandsTextView setSelectedRange:textRange];
[ocommandsTextView scrollRangeToVisible:textRange];
[pb declareTypes:[NSArray arrayWithObject:NSStringPboardType]
owner:nil];
[pb setString:[sender stringValue] forType:NSStringPboardType];
}
}
Ivan
Pe 2. aug. 2004 kl. 06.58 skrev Ivan Myrvold:
>
This works for the first search string I type in the NSSearchField.
>
The next search string I type in, is not used. Instead, the find panel
>
contains the first search string in the find field.
>
>
Ivan
>
>
Pe 1. aug. 2004 kl. 23.25 skrev Glenn Andreas:
>
>
> On Sunday, August 01, 2004, at 04:02PM, Ivan Myrvold
>
> <email@hidden> wrote:
>
>
>
>> I tried the following in the NSSearchField action method:
>
>>
>
>> NSPasteboard *pb = [NSPasteboard pasteboardWithName:NSFindPboard];
>
>> [pb setString:[sender stringValue] forType:NSStringPboardType];
>
>>
>
>
>
> In IDEKit, I do:
>
>
>
> NSPasteboard *pasteboard = [NSPasteboard
>
> pasteboardWithName:NSFindPboard];
>
> [pasteboard declareTypes:[NSArray
>
> arrayWithObject:NSStringPboardType] owner:nil];
>
> [pasteboard setString:[self findString]
>
> forType:NSStringPboardType];
>
>
>
> and it seems to work correctly - I'm guessing just adding the
>
> declareTypes:owner: should do it...
>
> _______________________________________________
>
> cocoa-dev mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
>
>
>
Ivan C Myrvold
OrtopediService AS
Mob. 913 16 356
Tlf. 38 14 45 93
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.