[haiku-bugs] [Haiku] #8105: BTextView: Erasing content outside TextRect

  • From: "bigmike" <trac@xxxxxxxxxxxx>
  • Date: Mon, 07 Nov 2011 18:02:30 -0000

#8105: BTextView: Erasing content outside TextRect
--------------------------------+------------------------------
 Reporter:  bigmike             |        Owner:  axeld
     Type:  bug                 |       Status:  new
 Priority:  normal              |    Milestone:  R1
Component:  Kits/Interface Kit  |      Version:  R1/Development
 Keywords:                      |   Blocked By:
 Blocking:                      |  Has a Patch:  0
 Platform:  All                 |
--------------------------------+------------------------------
 I just started playing around with Haiku a bit and I tried to subclass
 BTextView to extend it so that it shows line numbers to the left. I was
 trying to do this by setting TextRect.left to something bigger than 0 and
 override Draw() like this:

 {{{
 void HelloView::Draw(BRect updateRect) {
         BTextView::Draw(updateRect);
         // Draw line numbers to the left of TextRect ...
 }
 }}}

 I don't know if I am actually kind of misusing the API here, but '''when
 deleting lines (by pressing backspace) the TextView erases the content
 outside TextRect'''. I think the correct behavior can be achieved with the
 attached 1-line patch. :-)

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8105>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: