Page 1 of 1

need help with gui

Posted: Sat Jul 13, 2002 11:00 pm
by babyos
I Need REAL Help with making a gui for an os.i am making it in assembly(NASM) & all i can get it 2 do is be a "terminal" dos like os.i have graphics,i just need to knoe how to turn em' into a gui.

RE:need help with gui

Posted: Sat Jul 13, 2002 11:00 pm
by carbonBased
I'd recommend checking out the APIs for GUIs such as the KDE and Gnome for Linux.

I wrote a C++ GUI using a graphics library I wrote (check out www.neuraldk.org for more info... downloads->smoke).  It's not perfect (I wrote it years ago, and desperately needs updating, but it'll probably give you a basic idea).

My concept for a GUI is similar to Gnome's, I think (or java):

myWindow = new Windows;
myTable = new Table(rows, columns);
myTable.add(new Button(etc));
myTable.add(new Picture(etc));
myWindow.add(myTable);

and so on...

essentially, you simply add GUI elements to a window object, and formatting objects (such as "Table") control where they go... a table, for example, would give each element equal space on the screen, unless told otherwise (much like the <table> construct of html).

Also for formatting, you could add spacer objects, and so on.

I'd elaborate more, but... well, I'm drunk ;)  Head's buzzin, so I really shouldn't get into detail.  I'll try and post a better explanation later, but for the time being, check out smoke on www.neuraldk.org  Might help out.

j.

RE:need help with gui

Posted: Sun Jul 14, 2002 11:00 pm
by TheUbu
You first need to decide how supportive you want it to be you can use bios routines to set a few basic modes you can use vesa to set modes higher like 1024x768@32bpp linear or banked. If you go non vesa you will have to write a driver for each specific chipset. Other then that doing graphics is pretty straight forward you write out to the frame buffer pixle by pixle so you will need to first write some font library so you can see text again. And remember 8bpp mode uses a palette unlike 15/16/24/32/48


-Christopher

RE:need help with gui

Posted: Sun Jul 14, 2002 11:00 pm
by Stefan
This is my favorite part in programming ... In an assembler language is a little bit hard to implement (to many code lines to write), but nothing is impossible :)
You should take a look at Sword's library API ... there is an nice implementation around trees (lots of pointers) witch is made in C++, ... take a look on BeOS API also made in C++. Or you can do something like AWT or SWING from JDK (Java Development Kit).
There are a lot of tiny libs out there, but I think SWORD is easy to understand and also Open Source!!!


Good luck!

RE:need help with gui

Posted: Sun Jul 14, 2002 11:00 pm
by Stefan
If you need more help please contact me at [email protected] ... maybe i'll help also with some code ... any language (C, C++, PASCAL, JAVA, ASM, LISP ...) :)

RE:need help with gui

Posted: Tue Jul 16, 2002 11:00 pm
by crg
Yup, JAVA, ASM etc.. is especially useful in OSdev...