Hello everybody!
a few days ago, i read this post in the Advanced and Intermediate Projects -Thread:
Create an operating system prototype/emulator in Python. You might research into various operating systems to get an idea for what to implement.
Things you can implement: A login. A shell system. A explorer system (If done well enough, you can disable your own explorer process at startup and execute your own.) A desktop window. A web browser. (A project in and of itself.) A plain text editor. (Another individual project.) A control panel/system configuration set of utilities.
...and I thought it would be fun to realize a such project.
It should not be a real OS, only a python script that is launchable on every pc having a python interpreter.
It should have a task bar, an explorer, a desktop, etc... (as lrh9 already posted)
What I've done 'til now:
I decided to code it in pygame, it already has a sort of multithreading and is very flexible in design.
I now already have a window-class, which is used for displaying windows (SURPRISE!=)
'til now, you can move the windows around, close them and open new ones.
all the windows are based on pygame.sprite.Sprite, the window.update() function simply sets the position of the window if it is dragged.
at the end of the mainloop, every sprite (window) is redrawn with allwindows.update()
(-> nothing special....)
I have a taskbar (where the open windows will show up in some hours=), a start-button, that opens up a small menu where you can select the windows you want to display, and a "shutdown"-button that exits the script.
...but I've a few problems, perhaps you can help me fixing them?when the titlebars of two windows overlap and i start moving one of them, the other one moves too... the window's title bar is a rect...
same problem if two window's close-buttons overlap: both are closed...
-> how can i give a "topmost"-attribute to a rect? (or something like that...)
input: how can i make an input-box?? eg. for making a text-editor... have i got to make a big loop where pygame checks for every key press and blits it to the screen?or is there an easier way?
thank you for any suggestion!!
Greetz,
CobRalf