Basic 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
JamesParsons
Posts: 17
Joined: Sat Jan 12, 2013 7:37 am

Basic GUI

Post by JamesParsons »

I want to implement my OS with basic GUI. Since im not that good I need some help. If someone Could give me some basic code to start off with it would be great. All I want is too open a rectangle window w/ a smaller rectangle at the top with a title in it. also I would like a close box that can get rid of it. I know this is vague and not really helpful so here is an image example
Attachments
I'd prefer it to be the same colors
I'd prefer it to be the same colors
JamesOS.png (5.05 KiB) Viewed 1314 times
REAL programmers aren't afraid to use goto's
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Basic GUI

Post by iansjack »

The Wiki has extensive information and links to information about video output and mouse input (to answer your other query). That's the best place to start. Google will also lead you to plenty of other information.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Basic GUI

Post by sortie »

Making a GUI from scratch is hard. Hell, even creating a command line operating system from scratch takes a lot of effort. Stop! Don't think about these high level goals "And then you press here, then X happens!" and look at how the hardware really works. It's a lot of hard and fun programming to even get a basic OS with graphics up and running. Try look at the wiki for this community, all the hints you need are there.

Perhaps you'd be better off writing a Window Manager for X rather than an entire OS.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Basic GUI

Post by SpyderTL »

A full walkthrough to get a GUI up and running from scratch is a bit much for a forum post, but maybe I can set you up with some tasks to get you started.

1. Find a boot loader, or create your own.
2. Practice writing characters/text to video memory.
3. Use VESA to change your display mode.
4. Draw a horizontal line.
5. Draw a vertical line.
6. Draw a rectangle.
7. Fill a rectangle.
8. Read mouse input.
9. Draw a cross-hair mouse pointer.

Each one of these tasks will take you a day or two, and should be fairly straightforward to find more information on this site. If you get stuck, feel free to ask specific questions on this forum, and be sure to post some code. All of us started off exactly where you are, and there are plenty of people here that will be happy to help you out.

Good luck!
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply