Page 1 of 1

GUI

Posted: Sun Aug 01, 2010 2:39 am
by schulzy175
i need help on making a gui. good thing is i wanna make one for an os, bad news is i dont know where to start. yes i know i should probably start with the boot disc but i just wanna know how hard it is to make a gui for an os and where to start. please keep it simple though because im new with this type of scripting.

Re: GUI

Posted: Sun Aug 01, 2010 2:51 am
by f2
Have you looked in the OSDev Wiki? This will answer your questions.

Re: GUI

Posted: Sun Aug 01, 2010 5:07 am
by bontanu
What you need is:
1) a set of basic graphic routines:
1.a) draw horizontal and vertical lines, darker and lighter versions also (for 3D looks)
1.b) draw rectangles filled/non filled/ with color gradients
1.c) draw some text
1.d) draw some small images: icons, small arrows, close X buttons etc

2) Use the above routines to draw a basic window (caption, body, sunken edges) on screen

3) Handle events: like click, drag, mouse move and react to such events by resizing or moving the "window". Handle clipping to window extents.

4) Design a system that will allow a window to have child windows and thy can have child windows and so on. Handle overlapped windows and bring to front/back of windows.

5) Allow programmers to hook into your system and write event handling code and create such windows; design an API for this

6) Design a few basic controls: main window, button, edit, list box, combo box, tree view, list view, editor, image, icon, etc and offer them as defaults for your GUI

7) Re-iterate and refine this process.

Oh... and at last: design some fancy ICONS and window looks and skin your GUI :P

Re: GUI

Posted: Sun Aug 01, 2010 8:54 am
by gravaera
Hi:

As a bit of an add-on, and a refinement of that botanu said, "GUIs" are generally a combination of two programs, and one or more libraries. You have first an input server (windowing system), which handles user input. Then you have a program that handles window sizes, drawing windows, positioning them, and sending messages to windows that need updating: that's the window manager. Next you have N libraries to give control over how the widgets in those windows look. Those are widget toolkits.

It's always useful to know where the lines are drawn between distinct systems when designing.

--Good luck
gravaera

Re: GUI

Posted: Sun Aug 01, 2010 10:49 am
by Ready4Dis
Your best bet, would be to find a somewhat mature OS (something that has graphics support) and just write a GUI for an existing OS. Learning all the in's and outs of hardware just to write a gui seems a waste, and if that's your goal, find someone who needs help writing a GUI for their OS (or has one started but sucks at art and could use some help). It would take a very long time to get an new OS to the stage of developing the gui, especially if you know nothing about OS dev.

Re: GUI

Posted: Sun Aug 01, 2010 12:59 pm
by chibicitiberiu
May I suggest using MS-DOS as your base OS? It is pretty nice, and easy, you can start with 320x200x256 video mode which is really easy, so you get the hang of GUI programming, you can implement mouse support, eventually events... And then you can move on to higher resolutions, like SVGA, or VESA, and since MS DOS is in real mode, you can easily use bios interrupts for VESA video modes. Think that all early windows versions, until Windows Millenium used MS-DOS (except windows NT).

Of course, this is up to you, I just offered a suggestion.

Re: GUI

Posted: Sun Aug 01, 2010 10:41 pm
by schulzy175
can i just make a windows form then code it into the boot disc for it to show after it boots?

Re: GUI

Posted: Sun Aug 01, 2010 10:56 pm
by schulzy175
Would it be cheating if i just made my os out of a windows form, but then made the boot disc boot it?

Re: GUI

Posted: Mon Aug 02, 2010 1:59 am
by skyking
If following bontanu's suggestions steps 2-7 should be possible to do on any reasonable platform (if you put the routines to get keyboards and mouse events in step 1). Once you have constructed your OS API for graphics and input at this level the same API should be possible to implement on another platform (say Windows or X11) and you can develop the GUI under these (in fact most higher level stuff should be possible to develop on another OS, if you just take care of not using anything other than the ported API).

Re: GUI

Posted: Mon Aug 02, 2010 10:44 am
by bontanu
schulzy175 wrote:Would it be cheating if i just made my os out of a windows form, but then made the boot disc boot it?
It is very unlikely that you are able to do that. Windows forms require a lot of other subsytems and libraries and DLL's in order to execute...

What one could do is to copy an bitmap with them and simulate :))

But yeah that would be considered as "cheating" because here we do like to create our own GUI's :D... or at least I do prefer this.

Re: GUI

Posted: Mon Aug 02, 2010 12:44 pm
by chibicitiberiu
Personally I don't think you can make a GUI that uses the elements of another GUI, like forms and other stuff... And you won't be able to launch any windows application with your GUI, since windows already has it's own GUI... so I don't think it's going to work very well.
Still, there is something about Windows Media Center... I saw that it is able to substitute the windows GUI for the games, and even provide it's own menu interface... i'm not sure how it does it, but it's kind of interesting.

Re: GUI

Posted: Tue Aug 03, 2010 2:36 am
by thomasloven
Parhaps what you're looking for is something like Talisman Desktop?
http://www.lighttek.com/talisman.htm
Probably not what you had in mind, but it can be fun to play around with for a while, trying out desktop managing.