Jump to content




miniOS (well more of a window manager)

computer lua

10 replies to this topic

#1 Piorjade

  • Members
  • 244 posts
  • LocationComputer, Germany

Posted 23 October 2016 - 01:10 PM

Well I made a window manager in a day, because I was sooo bored :P/>

It literally is only one file with about 360 (heh) lines :)/>

Screenshots:

Spoiler

Features:
  • Press F1, enter the path to a file, press enter --> opens a window with that file
  • Maximize windows with the yellow button
  • Close windows
  • Minimize windows --> they run in the background (NOTE: currently no way of re-opening that window, I'll add that later...it's very easy)
  • Mouse, key and char events are only passed to the selected window
  • mouse events are correctly passed to the size of the window
  • mouse events won't be passed, if they are happening outside of the window (obviously...)
  • resize windows with the bottom right corner
  • move windows with the top border
  • Nothing else (---> miniOS)
Code:
GitHub

Download:
Pastebin

pastebin get qXqg8Weg /miniOS

Edited by Piorjade, 23 October 2016 - 10:04 PM.


#2 supernicejohn

  • Members
  • 98 posts
  • LocationSweden

Posted 23 October 2016 - 03:30 PM

Pretty much what I'm doing right now, just need to remember to correcrly map the mouse events... Thanks for mentioning!


#3 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 23 October 2016 - 07:27 PM

Seems nice, but how are programs going to be notified of size changes? Are they going to be fixed size?
(for example,
if miniOS then miniOS.Window[myWindowID].Size = {w=10,h=5} end --10x5 window 
)
If there is resizing functionality then, I have a suggestion! If you resize the window, scroll bars to look at windows!

Other than that, nice! I'm more fond of tabs though because you don't have to do all sorts of dark lua magic.
tl;dr i like tabs because im lazy and dont feel like handling anything except mouse clicks and key presses and that sort of stuff

Edited by Haddock, 23 October 2016 - 07:30 PM.


#4 Piorjade

  • Members
  • 244 posts
  • LocationComputer, Germany

Posted 23 October 2016 - 10:02 PM

View PostHaddock, on 23 October 2016 - 07:27 PM, said:

Seems nice, but how are programs going to be notified of size changes? Are they going to be fixed size?
(for example,
if miniOS then miniOS.Window[myWindowID].Size = {w=10,h=5} end --10x5 window 
)
If there is resizing functionality then, I have a suggestion! If you resize the window, scroll bars to look at windows!

Other than that, nice! I'm more fond of tabs though because you don't have to do all sorts of dark lua magic.
tl;dr i like tabs because im lazy and dont feel like handling anything except mouse clicks and key presses and that sort of stuff

Well I didn't do anything about notifying the program about resizes... I's kind of already happening when you call window.reposition() (--> the window gets smaller/bigger)... The only thing I can think of you can do, is handling term_resize in the program itself for whatever reason.

EDIT: I think I forgot to mention that you can resize windows by dragging the bottom right corner and move windows by dragging the top border? :P

Edited by Piorjade, 23 October 2016 - 10:00 PM.


#5 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 25 October 2016 - 10:23 PM

View PostPiorjade, on 23 October 2016 - 10:02 PM, said:

View PostHaddock, on 23 October 2016 - 07:27 PM, said:

Seems nice, but how are programs going to be notified of size changes? Are they going to be fixed size?
(for example,
if miniOS then miniOS.Window[myWindowID].Size = {w=10,h=5} end --10x5 window 
)
If there is resizing functionality then, I have a suggestion! If you resize the window, scroll bars to look at windows!

Other than that, nice! I'm more fond of tabs though because you don't have to do all sorts of dark lua magic.
tl;dr i like tabs because im lazy and dont feel like handling anything except mouse clicks and key presses and that sort of stuff

Well I didn't do anything about notifying the program about resizes... I's kind of already happening when you call window.reposition() (--> the window gets smaller/bigger)... The only thing I can think of you can do, is handling term_resize in the program itself for whatever reason.

EDIT: I think I forgot to mention that you can resize windows by dragging the bottom right corner and move windows by dragging the top border? :P

Yeah you did forget to mention it. Oh well. Don't forget, you somehow broke the shell API (or you did it on purpose, but its broken)
Well, to end me bumping this thread, last words: Time to start forking this and modding it so I could use/make this as an actual DE (¯\_(ツ)_/¯)

Edited by Haddock, 25 October 2016 - 10:33 PM.


#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 25 October 2016 - 11:05 PM

Moved to Operating Systems.

#7 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 12 November 2016 - 01:43 PM

You could make term.getSize change when you resize the window

#8 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 13 November 2016 - 09:54 PM

View Posthouseofkraft, on 12 November 2016 - 01:43 PM, said:

You could make term.getSize change when you resize the window
Most programs I've seen has some sort of variation of this at the top of the file:
local w,h = term.getSize()
So, I'm not sure if it would work.

#9 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 13 November 2016 - 10:20 PM

The idea is to queue a term_resize event, so that an observant script knows to call term.getSize() again.

#10 Piorjade

  • Members
  • 244 posts
  • LocationComputer, Germany

Posted 23 November 2016 - 11:49 AM

View PostBomb Bloke, on 13 November 2016 - 10:20 PM, said:

The idea is to queue a term_resize event, so that an observant script knows to call term.getSize() again.

I think I did that.... too long no CC lmao.

#11 Zecradox

  • Members
  • 34 posts
  • Locationwhy do you want to know

Posted 29 April 2018 - 04:05 PM

Cool

Edited by tjwld, 29 April 2018 - 05:22 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users