←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Window API [NEW TOPIC]

danielsv03's Photo danielsv03 07 May 2017

Hello! So i want to make like dragable multishell windows in my Graphical Operative system.
Would window API be the right choise? and can someone explain how window is usefull etc thanks!

//Daniel
Edited by danielsv03, 07 May 2017 - 04:40 PM.
Quote

ObloxCC's Photo ObloxCC 07 May 2017

Checkout my Oblox OS. The code should be easy enough to understand.
Quote

danielsv03's Photo danielsv03 07 May 2017

View PostObloxCC, on 07 May 2017 - 11:37 AM, said:

Checkout my Oblox OS. The code should be easy enough to understand.

I'm looking at it right now but its pretty hard for me too understand

Thoo i'wd be happy if someone like had a titorial or something
Quote

CLNinja's Photo CLNinja 07 May 2017

Making dragable windows is out of my realm, but i get the basic premise. You need to have windows setup (So yes, window API would be the best idea for part of it) that listen for click events, and then tell if you've let go or not. If you havnt and you move your cursor, move the window to the proper position.
Quote

danielsv03's Photo danielsv03 07 May 2017

View PostCLNinja, on 07 May 2017 - 04:12 PM, said:

Making dragable windows is out of my realm, but i get the basic premise. You need to have windows setup (So yes, window API would be the best idea for part of it) that listen for click events, and then tell if you've let go or not. If you havnt and you move your cursor, move the window to the proper position.


But is it possible to like run programs inside a window instead of a tab
Quote

danielsv03's Photo danielsv03 07 May 2017

SO this contiunes on my last topic if window api for be the right choise for multishell windowed programs but is it possibel to like run programs inside windowes maybe by usin window API or something like that insstead of tabs. I know this is possbile by simply having the program code inside the program that is runing the windows but in my case i can't do that
any help would be helpful :)

//Daniel
Quote

Dog's Photo Dog 07 May 2017

Yes, it is, take a look at Lyqyd OS
Quote

CLNinja's Photo CLNinja 07 May 2017

View Postdanielsv03, on 07 May 2017 - 04:38 PM, said:

View PostCLNinja, on 07 May 2017 - 04:12 PM, said:

Making dragable windows is out of my realm, but i get the basic premise. You need to have windows setup (So yes, window API would be the best idea for part of it) that listen for click events, and then tell if you've let go or not. If you havnt and you move your cursor, move the window to the proper position.


But is it possible to like run programs inside a window instead of a tab
Yes, its completely possible. If you create a window with the window API and redirect term to that, anything that happens will effectively be limited to the area of that box.
Quote

danielsv03's Photo danielsv03 07 May 2017

View PostCLNinja, on 07 May 2017 - 04:59 PM, said:

View Postdanielsv03, on 07 May 2017 - 04:38 PM, said:

View PostCLNinja, on 07 May 2017 - 04:12 PM, said:

Making dragable windows is out of my realm, but i get the basic premise. You need to have windows setup (So yes, window API would be the best idea for part of it) that listen for click events, and then tell if you've let go or not. If you havnt and you move your cursor, move the window to the proper position.


But is it possible to like run programs inside a window instead of a tab
Yes, its completely possible. If you create a window with the window API and redirect term to that, anything that happens will effectively be limited to the area of that box.


So i tried to do somethinglike this
myWindow = window.create(term.current(),15,5,20,10)
myWindow.setBackgroundColor(colors.white)
myWindow.clear()
term.redirect(mywindow)
print("hello")

But it says like invalid redirect
Quote

Exerro's Photo Exerro 07 May 2017

You wrote mywindow not myWindow in the term.redirect call.
Quote

danielsv03's Photo danielsv03 07 May 2017

View PostExerro, on 07 May 2017 - 05:20 PM, said:

You wrote mywindow not myWindow in the term.redirect call.

Thanks!
Quote

Lyqyd's Photo Lyqyd 07 May 2017

Threads merged. Please stick to one topic for series of related questions.
Quote