Hi there.
I am trying to design a "teminal-style" pane which displays incoming data from a serial port, using a StyleTextArea object.
New text is appended onto the end of the StyleTextArea object and removed from the beginning, to keep the total number of characters in the view the same.
I want the user to be able to scroll to say, halfway, and have the text he/she sees remain constant. Keeping the current view constant is easy if I had a way of finding what value moveTo() would result in the current view, as I can count how many characters have been removed, and then call moveTo() again with newValue = oldValue - numCharsRemoved.
If there any way to achieve this functionality? I was able to do it with a normal TextFlow node using the scrollY value (when it was wrapped in a ScrollPane), but since I read that getEstimatedScrollY() on a VirtualizedScrollPane does not work correctly if their are font size changes or wrapped lines, I'm not sure if I can rely on this.
Hi there.
I am trying to design a "teminal-style" pane which displays incoming data from a serial port, using a
StyleTextAreaobject.New text is appended onto the end of the
StyleTextAreaobject and removed from the beginning, to keep the total number of characters in the view the same.I want the user to be able to scroll to say, halfway, and have the text he/she sees remain constant. Keeping the current view constant is easy if I had a way of finding what value
moveTo()would result in the current view, as I can count how many characters have been removed, and then callmoveTo()again withnewValue = oldValue - numCharsRemoved.If there any way to achieve this functionality? I was able to do it with a normal
TextFlownode using thescrollYvalue (when it was wrapped in aScrollPane), but since I read thatgetEstimatedScrollY()on aVirtualizedScrollPanedoes not work correctly if their are font size changes or wrapped lines, I'm not sure if I can rely on this.