Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: textedit "auto" scroll  (Read 1368 times)
Jos? V.
Posts: 25


« on: June 15, 2021, 05:20:46 pm »

I'm using a textedit as a "log" window for a script.

So far I'm using "openPipe" to run the script and catch the execution stdout to a string variable.

I then display the string to the textedit(non editable) item and everything works as planned.
The issue I have is that I can't set the cursor or the scrollbars to the end of the textedit.

Is there any simple way to set the scrollbar or cursor to default to the bottom of the textedit?
Daniel N.
Posts: 6


« Reply #1 on: June 16, 2021, 08:20:26 am »

Hi, im putting the new output to the begining of the string, so that it is at the to of the Textedit an older outputs are scrolling out.
Jos? V.
Posts: 25


« Reply #2 on: June 16, 2021, 11:02:16 am »

I had tought of that. It is a good solution.

But in a lot of cases this console will be used as a "instructions manual" for the execution of the program.
This means that all existing programs would have to invert message output too, and that complicates things a bit.

Another good solution would be a way to enable the console view on GDC for a specific program or execution.
Is there a way to do this?
Reuben B.
Four Js
Posts: 845


« Reply #3 on: June 18, 2021, 06:24:22 am »

Hi.

Have a read of https://forum.4js.com/fjs_forum/index.php?topic=868.0

it should also be noted the performance of a TEXTEDIT like this isn't great if the TEXTEDIT is being continuously updated and the string gets large.  I recall a case where it was something like 20 characters on each line, and a ui.Interface.refresh after each line was added, so it was something like 20 characters sent across, then 40 characters sent across, then 60 characters sent across, 20,000 lines later it was 400,000 characters sent across.  A DISPLAY ARRAY + TABLE solution + normal ui.Interface.refresh considerations (https://4js.com/ask-reuben/ig-17/) will be more friendly on your network as the same information is not sent across the network many many times unnecessarily.

Quote
Another good solution would be a way to enable the console view on GDC for a specific program or execution.
Is there a way to do this?

There is but it is not a good solution as it does not go across to GAS or Web usage.  In the GDC Shortcut settings, on step 10 http://4js.com/online_documentation/fjs-gdc-manual-html/#gdc-topics/t_gdc_applications_shortcuts_creating_direct.html there are options for the connection strings to show or hide the terminal. So with some DISPLAY to stdout, you can show or hide the terminal.

Reuben

Register for WWDC 21 at https://4js.com/wwdc21online/

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Jos? V.
Posts: 25


« Reply #4 on: June 18, 2021, 04:41:18 pm »

Thank you Reuben.

I've read the forum post you suggested and changed to a table with an array of labels.
That with Dialog.setCurrentRow actually work quite fine!

Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines