I try to invoke scrolling in the StyledTextCtrl from code. The problem is that the the scrollvalue indeed is changed, if you look at the scrollbar, but in the textctrl itself nothing changes.
Try using the scroll related methods provided by the STC class itself, like ScrollToLine.
···
On 10/17/10 11:28 AM, Marcel Boon wrote:
'llo all,
I try to invoke scrolling in the StyledTextCtrl from code. The problem
is that the the scrollvalue indeed is changed, if you look at the
scrollbar, but in the textctrl itself nothing changes.
Try using the scroll related methods provided by the STC class itself,
like ScrollToLine.
I tried that too, but it didn’t work either. But I dicovered it actually did work only the styledtextctrl isn’t refreshed.
It depends on the position of the caret if I scroll, resize and reposition. I bind the UPDATEUI event, which of course happens at least every time the caret position changes. In the function I bind I do the resizing, repositioning, rescrolling. Repostioning and resizing works. But rescrolling doesn’t. When I put a rescrolling call in the init of StyledTextCtrl it works but not when I put it in the function I bind to the UPDATEUI event.
Can’t figure it out. Refresh doesn’t help either.
Marcel
···
Op 2010 10 18 04:08 schreef “Robin Dunn” robin@alldunn.com het volgende:
On 10/17/10 11:28 AM, Marcel Boon wrote:
'llo all,
I try to invoke scrolling in the StyledTextCtrl from code. The problem
is that the the scrollvalue indeed is changed, if you look at the
scrollbar, but in the textctrl itself nothing changes.
I seem to recall reading somewhere (perhaps in the Scintilla docs) that you should not do anything that changes the STC in the UPDATEUI event, and that it is intended for notifying the container that it should update itself if it is displaying things like the current row/column, enablinb/disabling copy/paste buttons, etc. So I would try doing your stuff from a different event and see if that helps, perhaps a timer or an EVT_IDLE handler.
···
On 10/20/10 8:11 AM, Marcel Boon wrote:
> Try using the scroll related methods provided by the STC class itself,
> like ScrollToLine.
I tried that too, but it didn't work either. But I dicovered it actually
did work only the styledtextctrl isn't refreshed.
It depends on the position of the caret if I scroll, resize and
reposition. I bind the UPDATEUI event, which of course happens at least
every time the caret position changes. In the function I bind I do the
resizing, repositioning, rescrolling. Repostioning and resizing works.
But rescrolling doesn't. When I put a rescrolling call in the init of
StyledTextCtrl it works but not when I put it in the function I bind to
the UPDATEUI event.
Well actually it seems to work. I just submitted the wrong value. I submitted the new scrollvalue and I have to submit the lines to scroll. Stupid mistake.
So the changes I want to make work, but I can’t get rid of the flickering at the moment. That is because I resize and repostion the STC sometimes. When that happens there is a flicker. Freeze and Thaw don’t prevent this it, so the event probably takes place after STC has updated the screen.
Actually I need an event that occurs before STC refreshes the screen. Or can I prevent STC refreshing the screen unless I want to refresh it?
Maybe it’s not a good idea to do all this in the UPDATEUI event, but it seems to work like I want. I don’t think there is a neat way to do it anyway. Well creating a text control from the bottom up, but well… this is my first python program… I don’t want to make it harder than it is.
I tried a lot of events and the UPDATEUI seems to work best. Better than a timer too. I just have to get rid of the flicker.
Marcel
···
On Thu, Oct 21, 2010 at 7:06 PM, Robin Dunn robin@alldunn.com wrote:
On 10/20/10 8:11 AM, Marcel Boon wrote:
Try using the scroll related methods provided by the STC class itself,
like ScrollToLine.
I tried that too, but it didn’t work either. But I dicovered it actually
did work only the styledtextctrl isn’t refreshed.
It depends on the position of the caret if I scroll, resize and
reposition. I bind the UPDATEUI event, which of course happens at least
every time the caret position changes. In the function I bind I do the
resizing, repositioning, rescrolling. Repostioning and resizing works.
But rescrolling doesn’t. When I put a rescrolling call in the init of
StyledTextCtrl it works but not when I put it in the function I bind to
the UPDATEUI event.
Can’t figure it out. Refresh doesn’t help either.
I seem to recall reading somewhere (perhaps in the Scintilla docs) that you should not do anything that changes the STC in the UPDATEUI event, and that it is intended for notifying the container that it should update itself if it is displaying things like the current row/column, enablinb/disabling copy/paste buttons, etc. So I would try doing your stuff from a different event and see if that helps, perhaps a timer or an EVT_IDLE handler.
That's what Freeze/Thaw are for. Maybe you just need to delay calling Thaw for a little longer? Or you could try calling it on the parent instead of the STC.
···
On 10/22/10 4:23 AM, Marcel Boon wrote:
Actually I need an event that occurs before STC refreshes the screen. Or
can I prevent STC refreshing the screen unless I want to refresh it?