Scrollbar Issues
Hello wxPython users,
I need to build a wx.TextCtrl (or something similar) that has the scrollable
region described below:
---------------------------Text To Display-----------------------
Header 1 text line---------------------------
Header 2 text line---------------------------
Header 3 text line---------------------------
Header 4 text line---------------------------
<–Not HScrolled–> <----Horizontally Scrolled---->
···
The headers need to be lined up with each line. The text lines can
be very long and need to be horizontally scrolled independently of
the line headers. The headers and text lines need to scroll vertically
together. Different ranges of the text lines need to be colored
differently and this needs to be a dynamic user triggered event, so
it would save a lot of work if this could be done with something like a TextCtrl.
There are two ways that I can think to do this:
1.) Place text in a TextCtrl and limit the text that can be horizontally scrolled so that the
headers are always available for each line.
—This seems like the easiest approach but I can find no way to control the
size of the region that is horizontally scrolled in wx.TextCtrl
2.) Load two windows into a splitter window. Perhaps a ListBox for the headers and a TextCtrl
for the text lines and sync their vertical scrollbars.
— I can catch EVT_SCROLLWIN from wx.TextCtrl but I cannot figure out how to
send scrolling events to a listbox. I tried wx.PostEvent(ListBox, e) but this did not
Work. Is there a way of registering one scrollbar’s events with another scrollbar?
Anyone who is gracious enough to help wins my eternal gratitude….
Jeads