[Biococoa-dev] KDTextView update
Alexander Griekspoor
a.griekspoor at nki.nl
Fri Apr 14 07:47:29 EDT 2006
Hmm, Koen take a look at the methods I override in the textview I
shared, it solved all those problems already.
For instance by using this:
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:
(NSString *)type{
// the docs say to call this first, so we do ;-)
[pboard types];
// try to read a string, if not succesful bummer, otherwise insert it
NSString *aString = [pboard stringForType: type];
if(aString){
[self insertText: aString];
return YES;
}
else
return NO;
}
You can read strings, rtf etc.
And you also have to override both setString and insertText.
I just checked out the svn, but your updated BCSequenceView was not
committed..
Cheers,
Alex
On 14-apr-2006, at 13:41, Koen van der Drift wrote:
>
> On Apr 13, 2006, at 9:28 PM, Koen van der Drift wrote:
>
>> We also need a method to return a plain NSString from richtext
>> input, though. For instance, I copy-pasted the short sequence that
>> Alex gave as an example (ATTAATAGATGAF ), but that was rich text
>> from Mail.app, so it showed up as follows in the view:
>>
>> rtmacanscgccartccasbrtnttbswsscharstHvtcacrtbrdgrnbdtabardardtabnatra
>> scATTAATAGATGA
>>
>> I couldn't find a method in the FoundationKit, so I started a
>> category method in BCUtilString, but it is not working yet. This
>> method can then also be used in BCSequenceReader.
>
>
> I think I solved that, I changed readSelectionFromPasteboard in
> BCSequenceView to only accept NSStringPboardType:
>
> - (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:
> (NSString *)type{
>
> // the docs say to call this first, so we do ;-)
> [pboard types];
> // try to read a string, if not succesful bummer, otherwise insert it
> NSString *aString = [pboard stringForType:
> NSStringPboardType]; // only accept plain strings
> if(aString){
> [self insertText: aString];
> return YES;
> }
> else
> return NO;
> }
>
> Would this break anything else? If not, I will commit it.
>
> cheers,
>
> - Koen.
> _______________________________________________
> Biococoa-dev mailing list
> Biococoa-dev at bioinformatics.org
> https://bioinformatics.org/mailman/listinfo/biococoa-dev
>
*********************************************************
** Alexander Griekspoor **
*********************************************************
The Netherlands Cancer Institute
Department of Tumorbiology (H4)
Plesmanlaan 121, 1066 CX, Amsterdam
Tel: + 31 20 - 512 2023
Fax: + 31 20 - 512 2029
E-mail: a.griekspoor at nki.nl
AIM: mekentosj at mac.com
Web: http://www.mekentosj.com
EnzymeX - To cut or not to cut
http://www.mekentosj.com/enzymex
*********************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/biococoa-dev/attachments/20060414/f6fdca6d/attachment.html>
More information about the Biococoa-dev
mailing list