From: <ni...@ja...> - 2004-09-28 11:43:49
|
Hi folks, I have a problem with a TextArea on my app. The TextArea initially has no text, but when a user presses the 'search' button it punts the results into the TextArea using .appendText(). This works brilliantly. However, when the results contains more data than can fit into the TextArea without it scrolling on the vertical, the TextArea does not show the text, I need to scroll up to see it. Unfortunately I haven't seen a way to fix this little niggle, can it be done ? Many thanks Nick. ------------------------------------------------- Everyone should have http://www.freedom2surf.net/ |
From: Alex T. <al...@tw...> - 2004-09-28 12:42:02
|
At 12:43 28/09/2004 +0100, ni...@ja... wrote: >Hi folks, > >I have a problem with a TextArea on my app. >The TextArea initially has no text, but when a user presses the 'search' >button >it punts the results into the TextArea using .appendText(). > >This works brilliantly. However, when the results contains more data than can >fit into the TextArea without it scrolling on the vertical, the TextArea does >not show the text, I need to scroll up to see it. > >Unfortunately I haven't seen a way to fix this little niggle, can it be done ? Right - adding to the text doesn't automatically scroll for you. There are various ways - probably many better than this one - but the easiest is self.components.TextArea1.ScrollLines(999999) (or some other suitably large number :-) ScrollLines will move you that many lines, if possible (i.e. it's a relative move, not an absolute number) -- Alex. |
From: <ni...@ja...> - 2004-09-28 13:18:46
|
Quoting Alex Tweedly <al...@tw...>: > There are various ways - probably many better than this one - but the > easiest is > self.components.TextArea1.ScrollLines(999999) > (or some other suitably large number :-) That does the trick, thankyou. Except I used .ScrollLines(-1000) Thanks again, Nick. ------------------------------------------------- Everyone should have http://www.freedom2surf.net/ |
From: Kevin A. <al...@se...> - 2004-09-28 14:17:43
|
On Sep 28, 2004, at 4:43 AM, ni...@ja... wrote: > Hi folks, > > I have a problem with a TextArea on my app. > The TextArea initially has no text, but when a user presses the > 'search' button > it punts the results into the TextArea using .appendText(). > > This works brilliantly. However, when the results contains more data > than can > fit into the TextArea without it scrolling on the vertical, the > TextArea does > not show the text, I need to scroll up to see it. > > Unfortunately I haven't seen a way to fix this little niggle, can it > be done ? > > Many thanks > Nick. > wxWidgets bug http://sourceforge.net/tracker/? func=detail&aid=665381&group_id=9863&atid=109863 Use ScrollLines(-1). I've brought up this bug on wx-users many times in the past and it has never gotten any attention, so I think it may be time to just add a line to the appendText method to workaround it. AFAIK, this only impacts Windows. ka |
From: <ni...@ja...> - 2004-09-28 14:31:03
|
Quoting Kevin Altis <al...@se...>: > wxWidgets bug > > http://sourceforge.net/tracker/? > func=detail&aid=665381&group_id=9863&atid=109863 > > Use ScrollLines(-1). > > I've brought up this bug on wx-users many times in the past and it has > never gotten any attention, so I think it may be time to just add a > line to the appendText method to workaround it. AFAIK, this only > impacts Windows. The WX devs dont seem to have time to fix that, I see you logged it over a year ago. With my setup [pythong 2.3.3, wxPython 2.5, PythonCard 0.8] the ScrollLines(-1) scrolls back 1 line. I need it to scroll back to line 1, the start, so ScrollLines(-100) should always manage that. Thanks for your help Nick. ------------------------------------------------- Everyone should have http://www.freedom2surf.net/ |
From: Kevin A. <al...@se...> - 2004-09-28 14:54:05
|
On Sep 28, 2004, at 7:30 AM, ni...@ja... wrote: > Quoting Kevin Altis <al...@se...>: > > >> wxWidgets bug >> >> http://sourceforge.net/tracker/? >> func=detail&aid=665381&group_id=9863&atid=109863 >> >> Use ScrollLines(-1). >> >> I've brought up this bug on wx-users many times in the past and it has >> never gotten any attention, so I think it may be time to just add a >> line to the appendText method to workaround it. AFAIK, this only >> impacts Windows. > > The WX devs dont seem to have time to fix that, I see you logged it > over a year > ago. > > With my setup [pythong 2.3.3, wxPython 2.5, PythonCard 0.8] the > ScrollLines(-1) > scrolls back 1 line. I need it to scroll back to line 1, the start, so > ScrollLines(-100) should always manage that. > > Thanks for your help > Nick. > Okay, what you want is different than the specified behavior of AppendText, so your solution or setInsertionPoint should work fine. There is actually mention of that issue in the doc string. If you don't want the display to change call Freeze() before you append the text and Thaw() afterwards. """Appends the text to the end of the text widget. After the text is appended, the insertion point will be at the end of the text widget. If this behavior is not desired, the programmer should use getInsertionPoint and setInsertionPoint.""" I just checked in the ScrollLines(-1) workaround for the TextArea component on Windows. ka |