What do you mean by “from scratch”?
If you mean that you'd like to start developing new GUIs using existing libraries, then you may want to take a look at the documentation for Qt (www.troll.no
). It provides very good tutorials (and I suspect there's something similar on the gtk homepage, although I haven't used gtk myself).
If, on the other hand, you want to learn how the Linux X-windows GUI works from the X server up, then you should look for documentation on a package called Xlib. Good books on Xlib are few, far between, heavy and expensive (in my experience) but it really is the lowest-level API for GUI development in common usage. There are also alternatives, like SVGAlib for drawing in the console rather than on an X server.