[Gambas-user] TextArea scrolling

Jussi Lahtinen jussi.lahtinen at ...626...
Tue May 26 18:34:52 CEST 2009


Thanks!
This solution works in my case:
TextArea1.Text &= "Something" & gb.NewLine
TextArea1.Pos = TextArea1.Length
TextArea1.EnsureVisible()


Jussi



2009/5/25 Benoît Minisini <gambas at ...1...>:
>> >> When adding line to textarea:
>> >> TextArea1.Text &= "Something" & gb.NewLine
>> >> Cursor jumps to column&line zero.
>> >
>> > Normal, you are assigning the Text property. Use the Insert() method
>> > instead.
>>
>>  Ok... I did it vb6 way...
>>  But there is still problem. Mouse click on the textarea mess up the
>> cursor position,
>>  and next insert ruins output. Even if ReadOnly property is True.
>>
>>  And also I use Mid$() to edit content of the textarea.
>>  Like this;
>>  Mid$(.Text, (Len(.Text) - iLastMessageLen), Len(.Text)) = (sTellMe &
>> gb.NewLine)
>>  It is meant to correct the output afterwards if needed.
>>  But maybe there is other way to erase last message and replace it
>> with new one... this is
>>  quickly converted from vb6 code.
>>
>>  Is there way to determine cursors last column and last line?
>>  At this point I'm not sure how to do this...
>>
>>
>> Jussi
>>
>
> Use The Pos property to set the position of the cursor. To solve your problem,
> just set the cursor to the end of the text before calling Insert:
>
> MyTextArea.Pos = MyTextArea.Length
> MyTextArea.Insert("text")
>
> Moreover, you must use UTF-8 String methods to deal with the contents of any
> GUI Text property.
>
> I suggest you read the documentation of the TextArea widget carefully!
>
> Regards,
>
> --
> Benoît
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://www.creativitycat.com
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list