On Wed, 24 May 2017 13:38:43 +0000 (UTC)
sp...@potato.field wrote:
> On Wed, 24 May 2017 17:31:08 +0530
> onlooker <
vec...@m-net.arbornet.org> wrote:
> >First I thought I would use gtk but later thought to use XCB
> >because gtk and other like others sit on top of xlib so why not
> >using libxcb but, after reading many blog posts, it seems that using
> >libxcb is not a wise decision as it is difficult and learning curve
> >is very steep. Any hint and advice?
>
> I don't see the point of XCB. The Xlib API isn't particularly hard to
> use though finding good documentation for it these days might be
> difficult as the O'Reilly Xlib programming books are AFAIK out of
> print.
I had the same question as the OP six months ago, and came to the same
conclusion.
Being skeptical of frameworks generally and having dabbled in GTK 10
years ago, I looked at the low-level options. They seemed to be:
xlib
xcb
Xt
The cool kids like xcb and claim xlib is obsolete, but I immediately
found holes in the documentation. Xt makes too many decisions for me,
although I admire its handling of user-configurable settings. For my
money xlib is just as relevant and useful today as it was in 1985.
Jim Gettys's original documentation, "Xlib ? C Language X Interface" is
a masterpiece. It's careful and precise. Every term is defined before
use, and used consistently. I won't say I was never confused, but I
will say I could never blame my confusion on the text.
Gettys was writing in the days before documentation style was
geek-casual. (Yo, bro, it's not like that.) The language is dense and
matter-of-fact, the jokes few. It can be a little intimidating if
you're not used to it, but it won't waste your time.
onlooker, if you go that route, don't forget the xlib functions are
documented with man pages. Once you understand roughly how, say,
XCreateGC works, the manual will get you the details quickly.
Working with xlib helped me distinguish between the various objects
maintained by the server, and learn what's a property of what. X being
a complex beast, the functions frequently have 5+ parameters and some
of the structures are leviathans. But it's all tractable and fairly
consistent, and yields to practice.
--jkl