OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 1:17 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Creating a GUI (the basics)
PostPosted: Tue Jun 19, 2001 11:00 pm 
I was just wandering if anyone had any sites or
tutorials for writing a GUI. I mean the very
basics. I have my own theories about how I could
create a GUI enviroment, but I imagine it wud be
very slow and look crap!

Any help is apreciated.

Chris Tomlinson
[email protected]


Top
  
 
 Post subject: RE:Creating a GUI (the basics)
PostPosted: Tue Jun 19, 2001 11:00 pm 
>On 2001-06-20 14:43:51, Chris Tomlinson wrote:
>I was just wandering if anyone had any sites or
>tutorials for writing a GUI. I mean the very
>basics. I have my own theories about how I could
>create a GUI enviroment, but I imagine it wud be
>very slow and look crap!
>
>Any help is apreciated.

I wrote one a long time ago (for DOS and Linux) and
basically took a look at the current API's, like
Xlib and Qt.

Essentially, a standard GUI implies a set of
commands that allow associating a function with
each event (keypress, mouse click, etc).

Drawing is accomplished by rendering the windows
in your decor, and redrawing only the parts that
need be (I used an array of rectangles to take
care of this).

I never did get much of the button/scrollbar/etc
stuff done (mostly just a windowed environment),
but what I was planning on doing was specifying
a bunch of formatting "widgets":

hline, vline, box, etc, etc

Which would allow you to add other widgets inside
them. Hline, for example, would format all
buttons, etc, given to it in a horizontal line.

Then you'd have "scrolled_hline" which would
include a scrollbar for when it extended beyond
its physical limits.

etc, etc, etc.

Hope that helps! It's a pretty wide topic, and I
don't wanna go on and on and on :)

j.weeks


Top
  
 
 Post subject: RE:Creating a GUI (the basics)
PostPosted: Mon Jun 25, 2001 11:00 pm 
>On 2001-06-20 14:43:51, Chris Tomlinson wrote:
>I was just wandering if anyone had any sites or
>tutorials for writing a GUI. I mean the very
>basics. I have my own theories about how I could
>create a GUI enviroment, but I imagine it wud be
>very slow and look crap!

I know one thing that has been very helpful for me
(even though I haven't finished any GUI yet).
It's a standard Borland's library that ships with
their DOS compilers (namely Turbo/Borland Pascal
and Turbo/Borland C/C++). The name of the
library is Turbo Vision. It's a text-based GUI
(IDEs of the compilers which I have mentioned
have been developed with use of it), it uses
OOP (basically OOP is the most important
thing in the entire library) -- every single
object that can be seen on the screen and might
react on some user input is a descendant from
one base object that has several general
data items and methods that are common to all
objects (namely: screen position and size,
draw method, handle event (handles messages from
input devices such as keyboard and mice and
messages from other objects) method and others).
From this base object you can derive everything
you want, the whole bunch of GUI elements such
as windows, dialogs, buttons, check and radio
boxes, lists, input strings (w/ or w/o validators),
menus, status bars, progress bars, etc etc.
If you have either Turbo Pascal compiler (v 6 or 7)
or Turbo C/C++ compiler (v 1.01 and higher) and
can program OOP stuff, you can dive in there
and see how this whole thing is working, its
entire architecture.
Personally, I like Turbo Vision very much because
it's a perfect example of using OOP which is
really useful. The design is damn simple and
straightforward even though sources of Turbo Vision
(TV) library or TV-based programs aren't short.
First time (when I was not understanding the whole
thing yet) I thought it's something weird and I
disliked to cope with TV and write long source
code for it. But some time later, when I had a real
need for a GUI for a project in the university,
I made half of a GUI based solely on the ideas
from TV. And it worked.
So stop scratching the head, get yourself some OOP
stuff to play with. I've given you the point,
use it.


Top
  
 
 Post subject: RE:Creating a GUI (the basics)
PostPosted: Sat Jul 07, 2001 11:00 pm 
go to ftp.x.org and download the *first* version of it.

in a subdirectory called the x server is in the directory "X" (hehe). it is still pretty small and understandable. but you should really have a look at as many api's as possible......


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], scippie and 92 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group