[4965] in Athena Bugs

home help back first fref pref prev next nref lref last post

Patch for "Xaw Text widget ^L behavior"

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Mon May 21 23:32:07 1990

Date: Mon, 21 May 90 23:31:43 -0400
From: "Jonathan I. Kamens" <jik@pit-manager.MIT.EDU>
To: xbugs@expo.lcs.mit.edu
Cc: bugs@ATHENA.MIT.EDU

  The following patch to Xaw/Text.c fixes the bug recently reported by
me about ^L not behaving properly.  The problem is that the function
which handles the redisplaying assumes that the insertion point is
currently on-screen when the function is called, and this assumption
is not always valid (of course, it can be argued that THAT is a bug,
but that's another story).

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710


*** /tmp/,RCSt1000123	Mon May 21 23:30:44 1990
--- Text.c	Mon May 21 23:07:12 1990
***************
*** 2120,2129 ****
  _XawTextClearAndCenterDisplay(ctx)
  TextWidget ctx;
  {
!   int insert_line = LineForPosition(ctx, ctx->text.insertPos);
!   int scroll_by = insert_line - ctx->text.lt.lines/2;
  
!   _XawTextVScroll(ctx, scroll_by);
    DisplayTextWindow( (Widget) ctx);
  }
    
--- 2120,2134 ----
  _XawTextClearAndCenterDisplay(ctx)
  TextWidget ctx;
  {
!   int insert_line, scroll_by;
  
!   do {
!        insert_line = LineForPosition(ctx, ctx->text.insertPos);
!        scroll_by = insert_line - ctx->text.lt.lines/2;
! 
!        _XawTextVScroll(ctx, scroll_by);
!        _XawTextBuildLineTable(ctx, ctx->text.lt.top, FALSE);
!   } while (! IsPositionVisible(ctx, ctx->text.insertPos));
    DisplayTextWindow( (Widget) ctx);
  }
    


home help back first fref pref prev next nref lref last post