Display text information in scene

Typically: "How do I... ", "How can I... " questions
Post Reply
pwyq
Posts: 18
Joined: 28 May 2021, 19:30

Display text information in scene

Post by pwyq »

Hi Coppelia,

I'm wondering if CoppeliaSim has a similar function like QTextEdit in PyQt, which can display large trunk of text in real-time? Essentially I would like to display the info from the status bar in the scene (floating window also works).

I checked `sim.displayDialog`, but it opens new message box everytime and its box size changes based on the length of text.

It would be much appreciated if you may help me on this. Thank you!

Cheers
Last edited by pwyq on 09 Jun 2021, 03:08, edited 1 time in total.

pwyq
Posts: 18
Joined: 28 May 2021, 19:30

Re: Display information in scene

Post by pwyq »

I found simTextEditor functions and an example snippet of XML. Is there any way I can append info to the text editor?

--

I found <text-browser> for simUI.create(). I believe I can update the text by simUI.setText, how should I found the widget ID thou?
Last edited by pwyq on 09 Jun 2021, 02:59, edited 2 times in total.

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Display information in scene

Post by fferri »

pwyq wrote: 09 Jun 2021, 01:15 I found <text-browser> for simUI.create(). I believe I can update the text by simUI.setText, how should I found the widget ID thou?
if your UI XML is:

Code: Select all

<ui>
    <text-browser id="1" />
</ui>
then id is 1 :-)

pwyq
Posts: 18
Joined: 28 May 2021, 19:30

Re: Display text information in scene

Post by pwyq »

Hi fferri, Thank you for the great custom UI extension!

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Display text information in scene

Post by coppelia »

Hello,

please also have a look at sim.auxiliaryConsoleOpen

Cheers

Post Reply