Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Help to prevent double-text in canvas (on top of each other)

edited April 2015 in OpenSesame

Hi,

I need help with an inline-script. It works fine with a csv-file until line 4. Then it shows the text of line 3 together with all parts at the respective points of the following lines. Since reorganizing the csv-file didn't help at all, it must be due to an error within the script. Everything else works, it's just the representation of the text in canvasses which is doubled from the fourth line on.

# Code of the canvas:
linebreak = "<br><br>"
context= context1 + linebreak + context2
context_canvas.text(context)
context_canvas.show()

From the 4th line on, this canvas always shows the one of the 3rd line, too.


Update: When I copy the first 3 lines, they're always represented in the right way. The first line after them is doubled again. I already checked line-endings in the csv-file, all the same. The file is encoded in UTF-8.

Comments

  • edited 2:24PM

    Hi Kiri,

    Your problem description is not very clear to me. The text you want to display is doubled?

    It might be that you just need to clear the canvas (context_canvas.clear()) before you write text on it again. Otherwise, the things written on your canvas will just stack up.

    Let me know if this works!

    Cheers,

    Josh

  • edited 2:24PM

    Hi Josh,

    thank you very much.
    I set context_canvas.clear() right before writing new content to it, now it works.
    It seems to have been stacked up.

    Cheers,
    Kiri

Sign In or Register to comment.