I have 2 questions:

1. Does anyone know how to make X program that will give the output of the recently made program? I made a program that tells how many RAM is buffered, used, free and how many swap is used and free. Also it tells how many processes are running. Now I want to put the output in a window. The problem is I want to do this with Xlib.

2. This one is also about Xlib: how to put buttons in window with Xlib?

Any ideas?