[Biococoa-dev] BCSequenceView
Koen van der Drift
kvddrift at earthlink.net
Sat Mar 5 18:42:46 EST 2005
On Mar 3, 2005, at 3:01 AM, Charles PARNOT wrote:
> My gut feeling is that subclassing NSTextView is 'evil', and that
> instead the NSTextView should be a ivar and a subview (taking all the
> space for now, but in the future a BCSequenceView could have several
> subviews with several text fields like 'sequence length', 'current
> selection',...), and that BCSequenceView could be the NSTextView
> delegate to respond to user input and reformat the text view contents
> accordingly. Sorry this is not very detailed, so you can ignore it if
> that does not make sense!
If BCSequenceView is the delegate, then I wouldn't call it a view :)
Apple actually documents subclassing an NSTextView, so I don't see why
it is evil. I think what you have in mind is more a complete window,
with a view, and several widgets. For that you would need to create a
controller class, probably a NSWindowController subclass.
If we want more control over the way the sequence is displayed in a
view, overriding NSLayoutManager et al, as explained by Alex is
probably the way to go. I am not sure however, if that would be in
place 'in the framework' of BioCocoa.
- Koen.
More information about the Biococoa-dev
mailing list