Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > b8240933842cee58f4e7ce03017867c5 > files > 15

libsx-devel-2.05-18.fc12.i686.rpm

<title>libsx</title>

<h1> libsx - Simple X Library </h1>
<p>
<ul>
 <li> <a href="#I"> Introduction to libsx </a>
 <li> <a href="local.libsx.html"> Local Libsx Information </a>
 <li> <a href="general.libsx.html"> General Overview of libsx </a>
 <li> <a href="functions.html"> List of libsx Functions </a>
 <li> <a href="#A"> Acknowledgements </a>
</ul>
<hr>
<p>
<h2> <a name="I"> Introduction to libsx </a> </h2>
<p>
Welcome to libsx, the simple X library.  Libsx is an attempt to
simplify the vagaries of programming under X windows, making it simple
to create user interfaces for programs.  With libsx, 10 lines of code
may be all you need to create a user-interface complete with many
different types of widgets.
<p>
Libsx is layered on top of the Athena widget set and basically acts as
a front end to all the Athena and Xlib garbage so that programming
reasonable interfaces isn't so painful.  For example, libsx has a
simple to use one-line string entry widget that you can create with a
single function call (it's based on the Athena text widget but hides
all the gory details).  Libsx encapsulates the common operations
people usually want to perform in a window system and makes them easy
to accomplish (at the loss of some flexibility).
<p>
If you've ever wanted to just open a window with a few buttons and
draw some graphics, but were turned away by the complexity of trying
to do that, then libsx may be your ticket.  Libsx is capable of easily
creating many types of user-interface components each with a single
function call of a few arguments.  The library supports the following
Athena ``widgets'': 
<p>
<pre>
    - Labels
    - Buttons
    - Toggle buttons and Radio buttons
    - String Entry areas
    - Scrolling Lists
    - Menus
    - Scrollbars
    - Drawing Areas
    - Text Edit boxes
</pre>
<p>
The goal of libsx was to make the creation and manipulation of each of
these items as simple as possible.  The standard simplicity litmus
test is a "Hello World" program, which in libsx is:
<p>
<pre>
#include "libsx.h"
main()
{
  MakeLabel("Hello World");
  MainLoop();
}
</pre>
<p>
More complicated interfaces use a similar style of creation and
complete applications usually require less than 30 lines of code to
create an entire user interface complete with menus, buttons, string
entry widgets, etc.  For example, to create an application that opens
a window with a drawing area and a ``Quit'' button, all one must do
is:
<p>
<pre>
#include "libsx.h"

main()
{
  Widget quit_button, draw_area;
	      
  quit_button = MakeButton("Quit",     quit,       NULL);
  draw_area   = MakeDrawArea(500, 500, draw_stuff, NULL);

  SetWidgetPos(draw_area, PLACE_UNDER, quit_button, NO_CARE, NULL);

  MainLoop();
}
</pre>
<p>
So in only a handful of lines of code, we created a simple X
application that would have required inordinate amounts of code using
traditional methods.  All that is required now is for the user to
write the routines ``quit'' and ``draw_stuff''.  
<hr>
<p>
<h2> <a name="A"> Acknowledgements </a> </h2>
<p>
Libsx was developed by Dominic Giampaolo.  Quoting from the author:
<p>
"I developed libsx over the course of about 2 years while in
graduate school at Worcester Polytech (in good ole Worcester, Mass.)
It all started when I took the grad course in Computer Graphics. I
wanted a nice library of routines to deal with all the X crap so I
could concentrate on my graphics code.  Soon the library started
evolving into a much more sophisticated thing and when I became the TA
for the graphics course, I beefed it up a lot.  When you have 65
undergrads beating on a library you've written, it's got to be solid.
The next time that I was TA, I polished up some more rough edges in
the library (the stuff the students complained about) and it went
through the ringer a second time with about 45 more students.
Finally, during the summer of 1993 I added a ton of more functionality
to the library so a friend of mine could write his 3-D editor the way
it should be written and so I could do some stuff I wanted to do.
In September of 1993 I was hired at SGI and I've done a little bit more
work on libsx since I've been here (mainly little cleanups and the
rudimentary OpenGL support).  That is effectively what you see today."
<p>
"I've spent a lot of time deciding how to structure libsx so it
would be easy to use but still be open ended.  Libsx doesn't try to
hide all of X, it just tries to make it more digestable.  The library
has gotten pretty big at this point, but it should be sufficient to
write most types of GUI programs without lots of fuss."
<p>
"I've also spent a lot of time deciding what should and shouldn't
be in libsx.  It's too easy to throw in everything just because it's
easy to do so.  Unfortunately that's almost never the right reason to
include something.  I've tried to pare the design down to the
essentials needed to write a useful application.  Comments and
critiques of the design/approach are welcome (I'd like to hear what
others have to say about it or how they would have done it)."
<p>
In the past year (1994) I've received quite a bit of e-mail regarding
libsx.  I've received all kinds of comments, suggestions, and bug-fixes
from a large number of people out there.  If I had kept better track of
everything I'd launch into a big spiel thanking all the individuals.  Alas,
I didn't keep track of everything, so I'll just have to offer a general 
thanks to all the folks who sent me comments, asked for fixes, and offered
replacement code, etc.  Thanks folks, I do appreciate it.
<p>
<pre>
      Dominic Giampaolo
      dbg@sgi.com
</pre>
<p>
Libsx includes David Nedde's Athena drawing area widget and encapsulates it
so that a simple program to open a window and draw some graphics is
now reduced to only a few lines of code.
<p>
The HTML documentation was done by Winston Holmes (winston@nestor.engr.utk.edu)
by adding the HTML formatting codes to the doc files shipped with libsx.