GUI

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
schulzy175
Posts: 5
Joined: Sun Aug 01, 2010 2:32 am

GUI

Post 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.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: GUI

Post by f2 »

Have you looked in the OSDev Wiki? This will answer your questions.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
bontanu
Member
Member
Posts: 134
Joined: Thu Aug 18, 2005 11:00 pm
Location: Sol. Earth. Europe. Romania. Bucuresti
Contact:

Re: GUI

Post 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
Ambition is a lame excuse for the ones not brave enough to be lazy; Solar_OS http://www.oby.ro/os/
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: GUI

Post 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
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: GUI

Post 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.
chibicitiberiu
Member
Member
Posts: 68
Joined: Thu May 28, 2009 11:46 pm

Re: GUI

Post 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.
Tibi,
Currently working on the Lux Operating System
schulzy175
Posts: 5
Joined: Sun Aug 01, 2010 2:32 am

Re: GUI

Post by schulzy175 »

can i just make a windows form then code it into the boot disc for it to show after it boots?
schulzy175
Posts: 5
Joined: Sun Aug 01, 2010 2:32 am

Re: GUI

Post 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?
skyking
Member
Member
Posts: 174
Joined: Sun Jan 06, 2008 8:41 am

Re: GUI

Post 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).
bontanu
Member
Member
Posts: 134
Joined: Thu Aug 18, 2005 11:00 pm
Location: Sol. Earth. Europe. Romania. Bucuresti
Contact:

Re: GUI

Post 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.
Ambition is a lame excuse for the ones not brave enough to be lazy; Solar_OS http://www.oby.ro/os/
chibicitiberiu
Member
Member
Posts: 68
Joined: Thu May 28, 2009 11:46 pm

Re: GUI

Post 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.
Tibi,
Currently working on the Lux Operating System
thomasloven
Member
Member
Posts: 89
Joined: Tue Feb 26, 2008 10:47 am
Location: Sweden

Re: GUI

Post 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.
Post Reply