old-www/HOWTO/XWindow-Overview-HOWTO/client-applications.html

158 lines
3.1 KiB
HTML

<HTML
><HEAD
><TITLE
>Client Applications</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="X Window System Architecture Overview HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Window Managers"
HREF="window-managers.html"><LINK
REL="NEXT"
TITLE="Widget Libraries or toolkits"
HREF="toolkits.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>X Window System Architecture Overview HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="window-managers.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="toolkits.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CLIENT-APPLICATIONS"
>5. Client Applications</A
></H1
><P
>Let's focus on the client programs for a moment. Imagine you
wanted to write a client program from scratch, using only the
facilities provided by X. You'd quickly find that Xlib is pretty
spartan, and that doing things like putting buttons on screen, text,
or nice controls (scrollbars, radio boxes) for the users, is terribly
complicated.</P
><P
>Luckily, someone else went to the trouble of programming these
controls and giving them to us in a usable form; a library. These
controls are usually known as "widgets" and of course, the library is
a "widget library". Then I just have to call a function from this
library with some parameters and have a button on-screen. Examples of
widgets include menus, buttons, radio buttons, scrollbars, and
canvases.</P
><P
>A "canvas" is an interesting kind of widget, because it's
basically a sub-area within the client where i can draw
stuff. Understandably, since I shouldn't use Xlib directly, because
that would interfere with the widget library, the library itself gives
a way to draw arbitrary graphics within the canvas widget.</P
><P
>Since the widget library is the one actually drawing the
elements on-screen, as well as interpreting user's actions into input,
the library used is largely responsible for each client's aspect and
behavior. From a developer's point of view, a widget library also has
a certain API (set of functions), and that might define which widget
library i'll want to use.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="window-managers.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="toolkits.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Window Managers</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Widget Libraries or toolkits</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>