Gift Guide

X Window Programming From Scratch

( 1 )


X Window Programming From Scratch shows how to create a graphical user interface and accomplish graphic rendering using the X Window System software. It offers a unique approach to skill development by leading you through basic to very advanced concepts. This book provides a guide to the Linux operating system for application development, step-by-step instruction to the correct usage and syntax of C, a comprehensive introduction of the X Window System for interface creation and graphic rendering, and a complete ...
See more details below
Available through our Marketplace sellers.
Other sellers (Other Format)
  • All (9) from $7.91   
  • New (1) from $85.72   
  • Used (8) from $7.89   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2008

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.


Ships from: Naperville, IL

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by
Sending request ...


X Window Programming From Scratch shows how to create a graphical user interface and accomplish graphic rendering using the X Window System software. It offers a unique approach to skill development by leading you through basic to very advanced concepts. This book provides a guide to the Linux operating system for application development, step-by-step instruction to the correct usage and syntax of C, a comprehensive introduction of the X Window System for interface creation and graphic rendering, and a complete structured project to "learn by doing."
Read More Show Less

Editorial Reviews

Introduces programming in the X Window system environment using the C language and the Linux operating system. The second half of the book walks through the assembly of a functional graphics editor application. An appendix provides vector font sets. The CD-ROM contains project source code, shell scripts, and Red Hat Linux 6.2. Annotation c. Book News, Inc., Portland, OR (
Read More Show Less

Product Details

  • ISBN-13: 9780789723727
  • Publisher: Que
  • Publication date: 7/25/2000
  • Series: From Scratch Series
  • Edition description: BK&CD-ROM
  • Pages: 800
  • Product dimensions: 7.43 (w) x 9.14 (h) x 1.80 (d)

Table of Contents


Section One: Starting Points.


1. UNIX for Developers.
The man Command. Organization and Navigation.
Directories. Permissions. chmod. The cd Command.
The C Compiler. Object Files. Source Files. The vi Editor. The make Utility.
The cc Command. Makefile.
System Tools and Useful Commands.
grep, Pipes, Redirection, and more. The find Command.
Next Steps.

2. Programming Constructs.
The if Statement. The else Statement. Types of Conditions. The if else Statement. The case Statement.
The for Loop. The while Loop. The do while Loop.
Declarations. Return Type. Function Name. Parameters. Definition. The return Statement.
Data Types. Next Steps.

3. A Word on C.
Hello World.
Comment Tokens. The Function main. Code Bodies. Variable Scope. Built-In Functions. Memory Management. Dynamic Memory Allocation. Memory Leaks. Definitions and Macros.
Conclusion. Next Steps.


4. Windowing Concepts.
Origins of the X Window System. The Pieces of X.
Client/Server Model. Window Hierarchy.
Next Steps.

5. Widget Sets.
The Power and Convenience of Using Widget Sets. The Athena Widget Set.
The Core Widget.Widgets That Manage Other Widgets. The Motif Widgets.
Next Steps.

6. Components of an X Window Application.
Connecting to the X Server.
Employing Widget Resources Using Variable Argument Lists.
Creating the Application Interface.
Creating Buttons. Creating Pixmap Icons. Assigning Actions.
Managing Windows. Processing Events. Summary. Next Steps.

7. Xlib Graphic Primitives.
The Graphics Context.
The GC Function. GCForeground and GCBackground. GCLineWidth. GCTile.
Graphic Primitive Functions.
XDrawPoint. XDrawLine. XDrawRectangle. XDrawArc. Filled Graphics.
Next Steps.


8. Vector Versus Raster Graphics.
Vector Graphics. Raster Graphics. Next Steps.

9. Object Bounds Checking.
Point-Array-Based Object Bounds. Arc Object Bounds. Employing Object Bounds. Next Steps.

10. Trigonometric and Geometric Functions.
Calculating Point and Line Intersections. Calculating Slope. Calculating Point and Arc Intersections. Next Steps.

11. Graphic Transformations.
Moving a Line. Moving an Arc.
Scaling a Line. Scaling an Arc.
Rotating a Line. Rotating an Arc.
Next Steps.

12. Coordinate Systems.
Rectangular Coordinates. Polar Coordinate System. Next Steps.

Section Two: Graphics Editor Application.


13. Application Structure.
Project Structure.
Laying Out the User Interface.
Parsing the Command Line. The getopt Function. The XtVaGetApplicationResources Function. Setting Up a Canvas. Building the Project. Next Steps.

14. Program Flow.
Processing Events. X Event Hooks.
Widget Callbacks. Event Handlers. Widget Translation Tables.
Next Steps.

15. Common Object Definition.
Line Object Data Structure. Text Object Data Structure.
Understanding Vector Fonts.
The GXText Data Structure. Arc Object Data Structure. Common Object Data Structure. Next Steps.

16. Object Manipulation.
Copying an Object. Deleting an Object. Refreshing Objects. Parsing for an Object. Managing Object Handles. Managing the Status of an Object. Processing User Navigation of Objects. Next Steps.

17. Utilities and Tools.
Common Object Creation.
Linked List Management.
Creating a Graphics Context.
Graphics Context Tiling.
Using the Cursor as State Indicator. Next Steps.

18. File Formats.
Understanding Files. Binary File Formatting. ASCII File Formatting.
Tagged File Formats. Position-Specific File Formats.
Magic Numbers. Next Steps.

19. Save and Restore.
File Format Strategy. Save and Restore Program Hooks. Common-Object Save and Restore. Object-Specific Save and Restore. Next Steps.


20. Latex Line Object.
Creating a Latex Line Object. Drawing and Erasing a Line Object. Finding a Line Object. Selecting and Deselecting a Line Object. Moving a Line Object. Scaling a Line Object. Copying a Line Object. Saving and Restoring a Line Object. Next Steps.

21. Pencil Line Object.
Creating a Pencil Object. Pencil Object Management. Next Steps.

22. Object Templates.
The Box Object. The Arrow Object. Next Steps.

23. Arc Object.
Creating an Arc Object. Drawing and Erasing an Arc Object. Finding an Arc Object. Selecting and Deselecting an Arc Object. Moving an Arc Object. Scaling an Arc Object. Copying an Arc Object. Saving and Restoring an Arc Object. Next Steps.

24. Vector Text Object.
Creating a Text Object. Drawing and Erasing a Text Object. Finding a Text Object. Selecting and Deselecting a Text Object. Moving a Text Object. Scaling a Text Object. Copying a Text Object. Saving and Restoring a Text Object. Next Steps.


25. Introduction to PostScript.
PostScript. Learning PostScript.
PostScript Commands.
PostScript Programming. Viewing PostScript Files.
Comments Understood by Ghostscript.
Next Steps.

26. Color Versus Black and White.
Determining a Printer's Capability. Defining Color Images for Black and White Printers. Next Steps.

27. Working with XImages and Colormaps.
Printing the Canvas. Creating an XImage. Creating a PostScript Prolog. Parsing the X Colormap. Writing the PostScript Page Definition File. Directing the Output to a Printer or File. Next Steps.


28. Extending the Graphics Editor.
Color. Line Attributes. Arc Angles.
Rotating Objects. Next Steps.

29 Adding Context-Sensitive Help.
Processing Help-Related Events. Widget Paths. Relating Widgets to Text. Next Steps.


Appendix A: Command Shells and Scripting.
UNIX Command Shells.
Command Shell Environment.
Scripting with the Bourne Shell.
Shell Variables. Writing a Script with Function Calls. Debugging Shell Scripts.

Appendix B: Application Layout Code Listing.
make.defines File Contents. GNUmakefile File Contents. gxMain.c File Contents. gxGraphics.c File Contents. gxGx.c File Contents. gxArc.c File Contents. gxLine.c File Contents. gxText.c File Contents. gxGraphics.h File Contents. gxIcons.h File Contents. gxBitmaps.h File Contents. gxProtos.h File Contents.

Appendix C: Additional Vector Font Sets and vector_chars.h.
Triplex Bold Italic Vector Font Set. The vector_chars.h Header File.

Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted June 6, 2000

    Writing a Graphics Editor using Linux, X Windows and C

    <P> Dear Readers, <P> I am in awe at the overwhelming positive response my book has received and sincerely hope that you, too, enjoy this work. <P> The idea for the book grew from the realization that software development is the combination of many disciplines. In order to write a computer program, you must know something about the operating system, programming constructs, a programming language, the graphics environment, and have an interesting idea for a project. 'X Window Programming from Scratch' provides detailed instruction on each of these elements and more. <P> My introduction to the X Window System began shortly after its release from MIT in the mid-1980s. I started programming in Linux shortly thereafter by downloading Debian Linux (v.96 if I remember correctly) from the Internet and working for days to install it. This experience turned to passion and has taken me to three continents and a dozen countries where I have instructed, developed, and debugged in C, C++, Java, X Windows, Motif, and even served as a system administrator. This text reflects many of the lessons I have learned over the years and I am confident it will be a welcome addition to your personal library both as a project book and as a reference. <P> A word of caution, however, as this book is not for the faint of heart! <P> The text guides you through the Linux operating system from the application developer's point of view. It introduces programming constructs and how to accomplish them using the C programming language. Further, it provides a comprehensive introduction to windowing environments and specifically the X Window System. And finally, it introduces the PostScript print language and how to write print drivers. The point of all this instruction is to lead you through a project to author a Graphics Editor application, so there is even some trigonometric and geometric mathematics thrown in for good measure. <P> When you complete this text you will be comfortable using Linux for application development (to include constructing project Makefiles), you will be an advanced C and X Window programmer, and lastly you will have a working Graphics Editor application capable of drawing, scaling, and moving lines, shapes, and text objects. The project also includes save and restore capabilities as well as a PostScript print driver. <P> I trust you are up to the challenge! <P> Regards, <P> John

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)