This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DubbelSoftware's profile picture

Tabs

Started by DubbelSoftware, 21 November 2017 - 06:51 PM
DubbelSoftware #1
Posted 21 November 2017 - 07:51 PM
Hello,

I tried to create a Tab API without using the multishell things. But it completely failed. I tried several things to make it, but didn't completely work well.
My question is that somebody can just explain me how to make a tab manager, that wil be able to run programs, but pause them too. And that if there are too many tabs, that it wil expand the bar or something. I hope somebody can help me with this.

-DubbelSoftware
KingofGamesYami #2
Posted 21 November 2017 - 08:34 PM
The major problem with running multiple programs is handling the event system properly. I have made a flowchart which hopefully explains most of what you'll have to implement. It's not perfect, but it is a nice visual.

Pausing is… difficult. It's technically possible to do, but could create some weird problems in certain programs, due to how events may or may not be used.

Have a go at implementing a co-routine manager for just one coroutine - a shell instance, running in a window. Once you've gotten that working, it shouldn't be to difficult to expand that program to include multiple programs, with customized event filtering based on which program is currently "active".
SquidDev #3
Posted 21 November 2017 - 08:59 PM
I don't know how much of this you've done already, but I'd really recommend studying the implementation of CC's existing multishell. It doesn't implement pausing of programs (which sounds like it could cause trouble) but everything else should be there in some form or another. Then, if there are parts in there that you get stuck on, then I'd be happy to explain them in more detail - until then it's hard to offer any specific help.