From: Dave <da...@sk...> - 2001-05-29 19:39:52
|
I used the select method as mentioned and it works perfectly. Thank you very much everyone, this list has proven to be an invaluable resource for me. Dave > -----Original Message----- > From: per...@li... [mailto:perl-win32- > gui...@li...] On Behalf Of Piske, Harald > Sent: Tuesday, May 29, 2001 3:17 PM > To: 'per...@li...' > Subject: RE: [perl-win32-gui-users] Appending to RichEdit? > > Actually, Morbus' approach is the better choice, if you don't mind my > saying > so. While simply getting the text and setting the appended text basically > works (btw: even $RE->{-text} .= $newText; would do), what happens is that > the whole field gets refilled and redrawn, using a lot of resources for > nothing. With a couple of hundred lines this may cause annoying flicker, > plus it shifts the scroll bar back to the top. Selecting "nothing" past > the > end of the contents and replacing the selection is the way to "go by the > book", so to speak. > > $RE->Select (1e9, 1e9); > $RE->ReplaceSel ($newText); > > With a scrollable textfield this would also have the nice side-effect of > scrolling the new line into view. This does not work for richedit fields > as > of 0.0.558 - there was a lengthy trail on this list about a work-around. > Bottom line, if you don't need text formatting, use a standard multiline > textfield instead of a richedit, it makes life easier. > > Sorry for bugging in > Have fun, > Harald > > | -----Original Message----- > | From: Anthony George [mailto:ag...@em...] > | Sent: Tuesday, May 29, 2001 11:59 > | To: per...@li... > | Subject: Re: [perl-win32-gui-users] Appending to RichEdit? > | > | > | Get the text, append, send it out: > | my $previousText=$RE->Text(); > | $RE->Text($previusText.$newText); > | > | > | On Tue, 29 May 2001 13:45:25 -0400 > | "Dave" <da...@sk...> mentioned: > | > | dave> This seems like it should be pretty easy, but I can't > | figure out how to > | dave> add text to a richedit window after the text that is > | already there. > | dave> > | dave> I need to be able to continually add lines to the > | window, from different > | dave> sources (from the clipboard , textfields / buttons ), > | then the user > | dave> needs to be able to edit it before sending it to print. > | dave> > | dave> The richedit module works really well, only I can only > | seem to add text > | dave> to it with > | dave> > | dave> $RE->Text("$data"); > | dave> > | dave> Everytime I do this it replaces the existing text. Is > | there a way to > | dave> append to the existing text instead( starting on a new line )? > | dave> > | dave> Thank you, > | dave> Dave > | dave> > | dave> > | dave> > | dave> _______________________________________________ > | dave> Perl-Win32-GUI-Users mailing list > | dave> Per...@li... > | dave> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > | > | <sig> Anthony George <ag...@em...> Systems Engineer. > | Do your technical services need medical attention? We can > | help. EMSTS, LLC. > | 800-304-8269 231-720-1600 http://www.emsts.com </sig> > | > | > | > | _______________________________________________ > | Perl-Win32-GUI-Users mailing list > | Per...@li... > | http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > | > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |