[Biococoa-dev] strider and gck format

Alexander Griekspoor mek at mekentosj.com
Sat Mar 25 10:35:34 EST 2006

Yes I know, and I only use 10pt courier in my apps for that reason ;-)
No seriously, this comes down to an extension of the view that I  
would like to see in the future. I think the view should have three  
properties accessors
- the font (which it already has of course, although we should make  
sure you can only set one font for the whole textview)
- the numbers of characters per column
- the column spacing

Based on the first two we should then calculate the columnwidth  
dynamically, and the  numbers_of_characters_per_column property can  
be used in the select by word range calculations.
> Regarding the 1-10 selection bug, it may be related to our 'hack'  
> to move the left margin to the right (kLEFT_MARGIN_WIDTH).
Hmm, I actually thought of the columnwidth because the problems are  
limited to exactly a column.
This is the email I try to post to the cocoa-dev list for a couple of  
times already (it contains some more info, also see the picture), but  
no success yet...

Hi all,

I ran in this weird bug and you guys are my last resort..
For a new DNA analysis program I subclassed Koen van der Drift's  
excellent NSTextView linenumbering variant and modified the  
textcontainer such that it automagically adds spaces between every  
10th character. I did this by overriding in NSTextContainer (see below).

This works beautifully except for this single strange behaviour where  
text is not selected if
A) there are more than 10 characters (is one column) present
B there's not more than 1 line of text.

Trying to select the first 10 characters is not possible and a  
reverse selection started at for instance char 20 back will stop  
always at character 11. If the textview does not contain more than 9  
characters selection goes fine in the first column! So does it when  
the textview contains more than one line of text!

In other words, I cannot select the 10 characters in the first column  
for some reason.
I've illustrated the problem in this screenshot: http:// 

Any solution / clue where to start looking would be enormously  
appreciated. Last bug standing before a release...

- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect
         remainingRect:(NSRect *)remainingRect
	// create space for the linenumber margin
	if(proposedRect.origin.x <= 0.0)
		proposedRect.origin.x = kLEFT_MARGIN_WIDTH;
	// set the width of a column of text
	proposedRect.size.width = columnWidth;
	// make sure we nicely break after a full column
     if (proposedRect.origin.x + 2 * columnWidth - 20.0 >= [self  
containerSize].width) *remainingRect = NSZeroRect;
     else {
         remainingRect->origin.x = proposedRect.origin.x +  
columnWidth - 10.0;
         remainingRect->origin.y = proposedRect.origin.y;
         remainingRect->size.width = [self containerSize].width -  
proposedRect.origin.x  + columnWidth - 10.0;
         remainingRect->size.height = proposedRect.size.height;
     return proposedRect;

                     ** 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
                     AIM: mekentosj at mac.com
                     E-mail: a.griekspoor at nki.nl
                 Web: http://www.mekentosj.com

Windows is a 32-bit patch to a 16-bit shell for an 8-bit
operating system, written for a 4-bit processor by a 2-
bit company without 1 bit of sense.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/biococoa-dev/attachments/20060325/317cc4da/attachment.html>

More information about the Biococoa-dev mailing list