Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!ub!dsinc!netnews.upenn.edu!msuinfo!news From: harperb@frith.msu.edu (Brett Harper) Newsgroups: comp.windows.x Subject: Determining cursor location in Text widget Message-ID: <1990Aug8.195716.4691@msuinfo.cl.msu.edu> Date: 8 Aug 90 19:57:16 GMT Sender: news@msuinfo.cl.msu.edu Organization: Michigan State University, College of Engineering Lines: 22 Hello, I have been playing around with trying to limit the number of lines that a Text widget will expand to. That is, I would like to constrain the Text widget to be exactly a certain number of lines. To do this I thought I would make a new translation for the RETURN key and in the action procedure I would find out the current line the cursor is on and if it is before the MAXLINE then call the regular newline() procedure, otherwise ignore the request. The problem is: I can't figure out how to get the position of the cursor in a Text widget! I have tried using stuff like the MaxLines(), and GetCursorBounds() routines mentioned in the TextSink object docs, but these appear to be private to the widget, and they are apparently not available for general use? Any suggestions? (on why these don't work, OR how it should be done) Thanks, Brett Harper harperb@frith.egr.msu.edu