0

I am trying to use iup.text to create a textbox linked to a text file. I want to display the text file in this textbox in real time.

local Visu = iup.text{ 
    multiline="yes", 
    --rastersize="x60", 
    expand="yes",
    readonly="yes", 
    --font="Times, Bold 12",
    SCROLLBAR="YES",
    AUTOHIDE="YES",
    BGCOLOR="0 43 54",
    fgcolor="255 255 255",
    --maxsize="x1000",
}
function refresh_txt()
    local f2 = io.open("txtfile.txt", "r")
    if not f2 then 
        Visu.value = "Empty File" 
    else
        Visu.value = f2:read("*a")
    end
end

The problem is, when the textbox is just actualized by the function refresh_txt()` the cursor is put at the beginning of the showed text and not at the end of the text as I want. So the text is constantly being refreshed and I can't scroll down because when I did it, the cursor goes to the first character of the first line.

I want an automatic vertical expand of the textbox when refreshed.

I think that the problem can be solved by some argument of iup.text, but I didn't found it.

Tony
  • 3
  • 2
  • To scrolldown is different than position the caret (input cursor). And vertical expand is also another completely different feature. – Antonio Scuri Jul 23 '18 at 20:25

1 Answers1

0

To scroll down after changing the text use VisuQSPI.scrollto = "99999999:1".

Antonio Scuri
  • 1,046
  • 6
  • 10