Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > setting the cursor to the end of a text edit

setting the cursor to the end of a text edit
Thread Tools
Fresh-Faced Recruit
Join Date: Apr 2002
Location: vancouver
Status: Offline
Reply With Quote
Apr 26, 2002, 03:07 PM
 
my app logs to a text edit box, but how do i get the cursor to always follow the text???

i tried the following but it does not work:

// end is the length of the text
selectionRec.selStart = end;
selectionRec.selEnd = end;
SetControlData(logField, kControlEntireControl, kControlEditTextSelectionTag, sizeof(selectionRec),&selectionRec);
// then i draw the control..
     
Junior Member
Join Date: Apr 2000
Location: San Francisco, CA
Status: Offline
Reply With Quote
Apr 26, 2002, 03:58 PM
 
Originally posted by djcornell:
<STRONG>my app logs to a text edit box, but how do i get the cursor to always follow the text???

i tried the following but it does not work:

// end is the length of the text
selectionRec.selStart = end;
selectionRec.selEnd = end;
SetControlData(logField, kControlEntireControl, kControlEditTextSelectionTag, sizeof(selectionRec),&selectionRec);
// then i draw the control..</STRONG>

How do you draw the control afterwards?

[ 04-26-2002: Message edited by: kamprath ]
--
Michael F. Kamprath
     
Fresh-Faced Recruit
Join Date: Apr 2002
Location: vancouver
Status: Offline
Reply With Quote
Apr 26, 2002, 04:15 PM
 
using DrawOneControl(logField);
     
Fresh-Faced Recruit
Join Date: Apr 2002
Location: vancouver
Status: Offline
Reply With Quote
Apr 26, 2002, 04:36 PM
 
Originally posted by kamprath:
<STRONG>


How do you draw the control afterwards?

[ 04-26-2002: Message edited by: kamprath ]</STRONG>

Im beginning to think that i am using the wrong textedit box, which should i use? when building the interface with interface builder, i chose the little text edit box and resized it big enough to show an application log. my program is a gui for a little server app that simply starts and stop the server. It pipes all the server output to the text edit box. I currently have two problems:

1) the cursor does not follow the appended text
2) if i paste large amounts of text into the text edit the prog crashes
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:54 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2