Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!cs.utexas.edu!uunet!kddlab!titcca!kogwy!ccut!piyopiyo!ott From: ott@piyopiyo.hatori.t.u-tokyo.JUNET (ott) Newsgroups: comp.lang.smalltalk Subject: Smalltalk/V286: moving cursor in Texteditor Message-ID: <16@piyopiyo.hatori.t.u-tokyo.JUNET> Date: 16 Jun 89 01:39:43 GMT Reply-To: ott@piyopiyo.hatori.t.u-tokyo.JUNET (max) Organization: Hatori Lab., Department of Electrical Engineering, Univesity of Tokyo Lines: 44 I finally got 286/V (or the other way around) running yesterday and started to transfer some of my methods for enhancing the texteditor from the PC version. Things have changed a lot and late at night I ran into the following problem I just cant explain. I want to move the cursor (I-beam) with the keyboard. Left, right, up and down works fine, but using the same method I can't properly move it to the end or beginning of a line. A stripped down version of the method I added to TextPane: selectBeginningOfLine | curPosition | curPosition := selection origin. selection selectBefore: ( curPosition x: 1). It leaves a copy of the cursor at curPosition, moves the cursor to the beginning and reverses the part of the line between. It does not select that area, as the reverse part stays. To move it to the end (only changed 'curPosition x: lastColumn') things are a bit different. A copy of the old cursor remains, the cursor is moved to the end, but invisible as a 2nd permanent copy of the cursor shape is copied to this position as well. In both cases the cursor is shifted to the right place and character input appears at the right place as well. But the move creates those strange artifacts. Has anyone figured out where exactly the cursor gets moved and the big idea behind TextSelection. I am quite lost and would appreciate any help. Thanks -max ------------------------------------------------------------------------------ Max Ott e-mail: Hatori Laboratory ott@piyopiyo.hatori.t.u-tokyo.junet@relay.cs.net Dept. of E.E.; U of Tokyo I am not a tourist, I live here, but +(81)-(03) 812 2111 Ext. 6761 would not mind being one.