4

I have stubbornly decided to learn Xlib programming for Linux GUIs, just for fun & the gained experience. I'm young and have lots of time to read useless stuff. Nobody seems to want people to learn this, though, as everywhere I look, askers are being bombarded with suggestions of using a toolset instead - usually Qt or wxWidgets. This is kind of sad, if nobody learns Xlib, who will continue development of e.g. wxWidgets? I will learn wxWidgets too, though, when I feel comfortable with Xlib.

So - with that out of the way - my question is: Is there a recommended book (or other resources) for learning Xlib programming, preferably with C++, but C is OK too. Windows programming has its Petzold, I was wondering if Xlib had some sort of equivalent.

  • Learning Xlib would be interesting, but XCB is more modern and better all around. – Zan Lynx Nov 01 '10 at 22:56
  • I'll take 'em both, thank you very much :) Hereby added to my list of things to learn. I'll start a new question on it - if needed - when I get that far. –  Nov 01 '10 at 23:02

4 Answers4

6

There used to be a whole series of books on X programming (they actually worked their way up to Xlib!) but the one you probably want is Xlib Programming Manual

Over a year later I ran across a "retro UNIX" imgur album which has a picture of it! Keeping good company with the Red Book (the Postscript Language Reference Manual) and another in the O'Reilly X series.

Ben Jackson
  • 90,079
  • 9
  • 98
  • 150
  • Wow that series! Used be on every UNIX guy I worked with's desk in the 90s – Preet Sangha Nov 01 '10 at 20:32
  • Ah nice one, you got anything more on those series? Might be interesting! –  Nov 01 '10 at 20:54
  • +1, That is the one that I used as well. The best I could find on he net – BЈовић Nov 01 '10 at 21:14
  • @oystein - I only now realized they were all published by O'Reilly, but they are long out of print. Last time I saw them all together was in a used bookstore 15 years ago. Unfortunately while there is a unifying X Window theme, with a common cover style and volumes numbered from low level topics to high level topics (I think 8 was Motif), I can't find a name for the whole series. I think they were all marked "The Definitive Guide to the X Window System" – Ben Jackson Nov 01 '10 at 21:34
  • I remember that X series. Three book set weighing about 40 pounds? Every shop had a set that no one ever read. Damn if I can remember the name. – Duck Nov 01 '10 at 21:42
  • Okay, it's probably overkill anyway :) –  Nov 01 '10 at 21:54
  • 1
    @Preet - I was one of those guys... a long time ago (yes, mid-90s). I've since lost the box of books, and they're probably out of date by now anyway. I totally respect oystein's fervor & desire to learn, but me personally, I appreciate the abstraction & cross-platform benefits of something like Qt nowadays. – Dan Nov 03 '10 at 15:30
  • @Dan: True, true. But you can do such *cool* things at a low X level. Like writing X clients that don't die but reconnect when the server restarts. – Zan Lynx Nov 03 '10 at 21:22
1

I found this on amazon: Fundamentals of X Programming

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
1

I liked one by Levi Reiss and Joseph Radin, I think it was "X Window inside and out" (I read a translated version). Of course, it's really outdated, and predates Xutf8* functions, XRender, XFt and client side fonts, XCB, XRandr, Composite, etc...

ninjalj
  • 42,493
  • 9
  • 106
  • 148
  • Hah a cheapo! http://www.amazon.com/exec/obidos/ASIN/007881796X/acmorg-20 I might get this one –  Nov 01 '10 at 22:45
0

Also found these books myself:

http://www.amazon.com/Introduction-Window-System-Oliver-Jones/dp/0134999975/ref=sr_1_4?s=books&ie=UTF8&qid=1288651669&sr=1-4 (old and expensive, but it's something)

http://www.amazon.com/Window-Programming-Scratch-Jesse-Libertys/dp/0789723727/ref=sr_1_25?s=books&ie=UTF8&qid=1288651711&sr=1-25 (this one is quite recent, compared to most other resources I could find, but it's got some bad reviews. Maybe worth the read)

http://www.amazon.com/Window-Toolkit-Complete-Programmers-Specification/dp/1555581781/ref=sr_1_44?s=books&ie=UTF8&qid=1288651754&sr=1-44 (supposedly good, actually on Xt, but I guess it might be worth the read)

And this website which seems to at least contain something usable: http://manuals.itc.virginia.edu/unixdocs/u014.xwindows.html

If anyone has read any of these, please leave a comment.