Textedit bugs in Max 8.5.1 (Workaround needed)
Hi,
I'm using a textedit object for log displays of virtual machines inside my project. Here is the video of it's use:
As you see one textedit object is shrinked in presentation mode another is the right size. One automatically scrolls and another just increase the size of textedit at the bottom. Both set to the same values of: Automatic scrolling 'on', Ignore Click 'off', Word Wraparound 'on', Suppress Qoutes Around Symbols 'off', Value Storage Mode 'off'.
Here is the simple patch I use for this project:
This code works fine in Max 6.1.10 however automatic scrolling doesn't work also as in Max 8.5.1.
All I need to do is to rework this code to put a question mark in front of the line then a space and then a list. I see in Max 8 documentation it stated that textedit doesn't accept lists and should display an error. However as you see on video my list works. I know if someone will help to find workaround for this it will not solve the bug that when one textedit outputs text line by line another one outputs it as a raw unseparated text. This is also unacceptable. I need to have up to 7 virtual displays for the virtual machines working as floating windows at the same time. However this workaround may solve the textedit automatic resize.
Thank you in advance!
Best regards,
Ruslan
Loading old patches in new max versions often cause some trouble, mostly due to attributes and similar, which got added or objects changed their behaviour.
I usually replace such troublemakers with fresh objects,
delete var names and so on.
I don't remember that textedit scrolled when more text lines got appended
in any version from 4 till 8.5
Textedit allways accepted lists, and proper way to add new lines is this :

you can combine your input into lists and send newline (ascii 13)
after
---------------
I would use something different to display input which needs to scroll.
Thank you Source Audio for your suggestions. I will definitely try your method. As you can see automatic scrolling works on one of textedit objects in my video. It just doesn't work on two simultaneously. I properly translated a project from Max 6 to Max 8 and the main part of work was to make stochastic selections work on gen~ again in Max 8. I found a workaround and this lists problem is the only problem which remains so far.
I tried your method and while it solves the problem with parentheses it doesn't solve the named textedit bugs. Textedit in presentation mode is really weird. I filed a bug to Cycling '74 support but they doesn't respond after initial reply.
I know Cycling guys are involved in RNBO right now but there are bugs, which haven't been solved in Max part of software since version 6.1.10. I think Max is Max first of all and while an ability to export patches opens a myriad of possibilities I still use my main Standalone software made with Max 8 as a backend for gen~ patches acting as iOS and Android apps. So, Cycling, please help!
can you post a simple patch demonstrating textedit scroll
when lines get more than it can display.
it makes me wonder how does that work.
You can use comment to display text just as well as in textedit
Source Audio, just enable Automatic Scrolling attribute in textedit and it will scroll, but only when you click on the text, which fills an entire textedit area. If two floating windows with textedit open in presentation mode it will only scroll in one textedit and not in two. So scrolling one textedit at a time is also considered a bug by me.
So there is no auto scroll at all, as expected.
Source Audio, you can view the video in my original post at the top of this thread, the left textedit scrolls and output the script work. I can't provide more generic patch as in the original thread subject as it is an integrated operation system expander (you can name it so) and to simulate it's behavior I need to reveal the whole project, which is a commercial one.
No problem, I have no interest in watching videos, in first place because
one can't see what is in the patch, and also
that autoscroll attribute you mention is only affecting a line which is longer than available space on a single text line.
there is no way I know off to let textedit auto scroll the lines
without clicking on it.
well, maybe if one would script select it and so on, but if I wanted to show number of lines,
let's call it a history of incomming messages, textedit would not be the choice
What if you send select to [textedit] after you append your text?
sure, one can select all, but would that look ok ?
I mean with highlighted text all the time
PDELGES, thank you this works on a single textedit. I should try it in whole patch this will take about 15 minutes.
PDELGES, here is the video of what happens, when I try to send select to multiple textedit objects after appending a list to them.
Source Audio, here is another draft of a solution using jit.gl.text3d. It is very basic at this stage and I can't pass through it to the point where there will be scroll bars and history of messages, but it is possible to display script output this way.
this is comment in bpatcher
thank you, will try this now!
offset is depending on font used
Source Audio, what does the part of an algorithm on the left of bpatcher do? Doesn't it scroll without it?
no, it does not auto scroll.
it is offset for bpatcher.
You can manually use scroll bar, but without offset message
it will not scroll by itself
ok, thanks! implementing this right now.
here is bpatcher, it is embeded in main patch I posted first
Source Audio, I have a problem in my main patch: the bpatcher starts to scroll not when the text fills to the end of it, but when the text reaches middle of bpatcher screen. Can you check this from your side?
Source Audio, can you please count an offset for such presentation rectangle 12. 25. 525. 500.?
And send me an updated patch, thanks in advance!
Source Audio, ok thank you very much! I inherited your sizes of bpatcher and now it works well!
sorry for late reply, I was away for a while.
You don't need to stick with sizes of my bpatcher or font type and size used in comment.
At the end important is that bpatcher shows exact number of text lines,
and that offset amount gets set for font type and size used.
I used Arial 12 and offset per line 13.4.
It is easy to test, as seen using uzi.
Bpatcher was adjusted to show exactly 20 lines.
After counter aproaches 20 , offset gets sent to bpatcher.
Source Audio, ok, I tested a patch for a while using this method running my engine for about 40 min with it turned on. Afterwards log display gets out of sync with real-time event display (I also used Arial 12 for the test). The set button as I understand clears the comment box, but after 40 minutes of output it becomes so huge so relative amount of time needed to return it back to original state. Overall method works fine, I can stick with 20 lines as for me it is important for auto scrolling to work.
I have another work in the patch you can be helpful of: I need to return angle values for roll, pitch and yaw angles into interface after they were set automatically. For this I need to convert them back to angle in degrees from 1.54 to 4 range. Are you familiar with angles and cross-directional conversion? If you are interested I can prepare a simple patch to show what I mean.
sorry, I am not familiar with that stuff, maybe someone else can help you with it.
----
About very large amount of captured text - I am sure that is not a job for the comment, which as you experienced can't work well with that many text lines.
If that becomes a problem, maybe you could try different things,
like capturing lines into coll or text object, and dumping
last x number of lines into comment for display.
or jit.cellblock etc.
or simply reset and restart after certain number of lines.
ok, I will start another thread for it later.
I just click clear button connected to set button and start again. I really don't need the logs all the time. The reason I need it is that I'm analyzing random chains of loops associated with virtual machines to set a cost for this chain. Later I plan to implement some algorithm for automatic cost setting. But for this I need to analyze a uniform random distribution happening inside Max.