hello,
what book will you suggest me to read if i want to learn gui using c language.?

Dani AI

Generated

For a one-month Red Hat delivery, aim for the fastest reliable route rather than mastering a low-level API. As warned, raw X11 is a long learning curve, and as pointed out, using higher-level libraries will save time. Two practical C-friendly paths work well: (A) build the GUI with a visual UI designer and use a 2D drawing backend for plots, or (B) generate plot images with a command-line plotter and display those images in a minimal GUI.

Suggested workflow (approach A, stays in C):

  • Start with a UI designer so most work is wiring callbacks, not hand-coding layouts.
  • Use the toolkit's drawing widget for plots and a 2D renderer for crisp axes/lines.
  • Implement a reusable data->pixel mapping function, draw axes/ticks in a separate pass, then draw series.
  • Add PNG export via the renderer so users can save plots.
    Timebox: 3–7 days to learn the UI builder and basic widgets, 7–10 days to implement plotting and export, remainder for interactivity and testing. Practical tips: enable anti-aliasing, double-buffer to avoid flicker, and test with small and large datasets early.

Approach B (fastest to a working demo): have your program call a plotting tool to produce a PNG, then load that PNG into an image widget. Example pattern (Unix-style) to stream data to a plotter:

FILE *gp = popen("gnuplot -persist", "w");
fprintf(gp, "set terminal pngcairo size 800,600\n");
fprintf(gp, "set output 'out.png'\n");
fprintf(gp, "plot '-' with lines\n");
for (i = 0; i < n; ++i)
    fprintf(gp, "%g %g\n", x[i], y[i]);
fprintf(gp, "e\n");
fflush(gp);
pclose(gp);

Book/resource pointers: for C-focused GUI work look for a book on the toolkit+drawing stack (one good starter is "Foundations of GTK+ Development" for GTK/C), and skim an Xlib reference only if you must go low level. Install the toolkit and renderer devel packages early (the *-devel RPMs on Red Hat), build a static PNG demo first, then add UI polish. , this approach should get you a working graphing GUI inside your month.

Recommended Answers

All 6 Replies

Depends. What operating system? For MS-Windows, do you want to use pure win32 api functions? If yes, here is a tutorial. But there are a lot easier ways to write gui programs nowdays. Two of them is CLR/C++ Windows Forms, and C# instead of C.

If you are thinking *nix, then look into low-level X11R6 (there are lots of books on that) or Motief. Again, C++ gives you more and easier options, sich as wxWidgets.

thank you.
i have linux red hat in office.

You could start here -- be prepared for a very long learning curve.

actually i have only one month time for completing my job.
i am developing gui which basically should generate graphs.

so let's see how good i can learn from this tutorials..
and thank you for your help.

thank you all. for your help..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.