Re: Hello and procmail request
----- Original Message -----
From: Joe Klemmer <email@example.com>
Sent: Wednesday, April 21, 1999 10:28 PM
Subject: Hello and procmail request
| Hi all, I have been wanting to learn X/GUI programming for a while
| and,after looking over lots of options, it seems that V would be the best
| one to use. So, if anyone has any tips or hints for an idiot programmer
| please feel free to share them. :-)
Pick a set of styles for functions and variable names, enums, and also in file organization and naming, and stick with your styles religiously. With complex dialogs it can be easy to get lost in the threads of event handling, etc. Generally, each event should have a function associated with it (e.g., each button, list selection, etc.).
For instance, for simple dialogs I put all the class functions into a single file, the usual C++ style. For complex dialogs, especially tabbed dialogs in which the number of event handlers can number in the dozens, I separate class function definitions into several files:
ld_*.cpp - loads data into the dialog
evt_*.cpp - contains the event handlers
get_*.cpp - retrieves data from the dialog
Likewise, I name my functions consistantly:
Evt_*() - event handlers
Ld_*() - loads data into dialog elements
Get*() - gets data from the dialog elements
A lot of GUI programming involves tedious management of arrays of strings, boolean flags, and numbers. First, consider creating a set of classes or templates to manage your arrays in a fashion that is common across your applications. This will help considerably in reducing the amount of coding and debugging.
Last note - GUI development can be quite a bit of intellectual fun, due to the requirement that you anticipate the needs, responses, and learning curve of the users, and the ability to visually experiment. Enjoy the artistic side as well!