Multitasking Window API
Jummit 12 Apr 2018
This is kind of the advanced version of ShellSplit, my first program that uses coroutines to achieve multitasking. This one is way more complex, featuring movable, resizable windows.
Demo at work:
Download:
API: pastebin get UQM4T3J3 programs.lua
DEMO: pastebin get HiqdSExG demo.lua
To try it out, just download the api and run the demo
Edited by Jummit, 12 April 2018 - 07:19 PM.
Demo at work:
Download:
API: pastebin get UQM4T3J3 programs.lua
DEMO: pastebin get HiqdSExG demo.lua
To try it out, just download the api and run the demo
Edited by Jummit, 12 April 2018 - 07:19 PM.
CCTech 14 Apr 2018
nice work looks pretty cool.
Would it be ok if I use this in my OS? I surely will credit you
Would it be ok if I use this in my OS? I surely will credit you
Jummit 14 Apr 2018
CCTech 14 Apr 2018
Lupus590 14 Apr 2018
CCTech 14 Apr 2018
Jummit 16 Apr 2018
A new version is out, now will display on top when selected. The api has not changed, so you can use the code you have made before the change.
minebuild02 20 Jun 2018
I would like to try and use it in my new OS that is currently in development.
CCTech 02 Apr 2019
Well uhm.. I'm not really sure that this is the right place but asking in "Ask a pro" would be not the best choice (I think?)
I tried to add this windows system to my OS and now I stuck at making a window handler.
It kinda works. It draws the windows but... they're black
Here are the codes:
inside the handler
And then if a new window is created:
The window that should appear is black without the topbar (Even if the positions aren't 1,1)
I tried it with some other programs which should run inside the window but with no success...
I have often rewrote the full code
I hope you can help me
I tried to add this windows system to my OS and now I stuck at making a window handler.
It kinda works. It draws the windows but... they're black
Here are the codes:
inside the handler
function drawWindows() while true do local event, var1, var2, var3 = os.pullEventRaw() if event == "terminate" then end windows.update(kernel.programs, event, var1, var2, var3) end end
And then if a new window is created:
function taskBar() windows.new(function() shell.run("/PowerOS/sys/taskBar)") end, 9, 1, 35, 2) end function drawDesktop() opscy.drawColor(colors.white) table.insert(kernel.programs, taskBar()) end
The window that should appear is black without the topbar (Even if the positions aren't 1,1)
I tried it with some other programs which should run inside the window but with no success...
I have often rewrote the full code
I hope you can help me
Jummit 03 Apr 2019
CCTech 03 Apr 2019
Jummit, on 03 April 2019 - 05:05 PM, said:
I need more of your code to help you. What does windows.update and windows.new do?
Uhh.. it's from your window API i just did
local windows = require(TheApiPath)
instead of
local program = require(TheApiPath)
It was all of my code that I posted which is for handling the Windows
Jummit 03 Apr 2019
CCTech, on 03 April 2019 - 07:38 PM, said:
Jummit, on 03 April 2019 - 05:05 PM, said:
I need more of your code to help you. What does windows.update and windows.new do?
Uhh.. it's from your window API i just did
local windows = require(TheApiPath)
instead of
local program = require(TheApiPath)
It was all of my code that I posted which is for handling the Windows
Your issue is that the taskBar function never returns anything. Here is the fixed code:
function taskBar() return windows.new(function() shell.run("/PowerOS/sys/taskBar)") end, 9, 1, 35, 2) end
CCTech 04 Apr 2019
Jummit, on 03 April 2019 - 07:49 PM, said:
CCTech, on 03 April 2019 - 07:38 PM, said:
Jummit, on 03 April 2019 - 05:05 PM, said:
I need more of your code to help you. What does windows.update and windows.new do?
local windows = require(TheApiPath)instead of
local program = require(TheApiPath)It was all of my code that I posted which is for handling the Windows
function taskBar() return windows.new(function() shell.run("/PowerOS/sys/taskBar)") end, 9, 1, 35, 2) end
Oh, indeed! Thanks for the quick support! Didn't thought about that it may needs to return something
CCTech 05 Apr 2019
aaand... sorry if I disturb you
I just think that I'm too... well I think you know what I mean..
Is there a way to reparent a window? I have a program that starts other programs but their windows only appear inside the programs window and not as seperate windows.
I also tried making a table and the update function inside the window handler (not your API) checks if it is empty. If not then it should move the window from inside the table inside the right table that contains all windows. Still only inside the window that runs it... So is there any way of "parenting" a window?
Thanks in advance
and: Am I allowed to modify the API a bit to change the window designs? I want to be on the safe side
I just think that I'm too... well I think you know what I mean..
Is there a way to reparent a window? I have a program that starts other programs but their windows only appear inside the programs window and not as seperate windows.
I also tried making a table and the update function inside the window handler (not your API) checks if it is empty. If not then it should move the window from inside the table inside the right table that contains all windows. Still only inside the window that runs it... So is there any way of "parenting" a window?
Thanks in advance
and: Am I allowed to modify the API a bit to change the window designs? I want to be on the safe side