For simple dialogs for simple programs, a full GUI system is a complete joke.
These systems have hundreds of functions that are inconsistent and unbalanced.
I installed GTKTerm. Guess what it would not run.
I had to chase up the missing dependencies.
Worse, I cannot post the programs because the source will not compile due to missing libraries.
My binaries will not even run on someone else's system due to missing libraries.
So build a simple GUI, but not use any libraries except for Xlib (which exists on every Linux system with X11).
I am going to take one of my programs (csv2dxf.c) and replace Zenity with my Dialog.h header file.
Lets call my GUI "Buttons", as it is conceptually a grid of buttons but with differing properties. The main constraint is that the grid is fixed width and fixed height.
So the following image is a two column by ten row grid. Each cell is 160 pixels wide by 50 pixels high.
Obviously I can merge cells such as the title and sub-titles.
Here is how the grid is defined:
// Here is our basic cell grid defintions --------------------#define cellWidth 160#define cellHeight 50#define cellColCnt 2#define cellRowCnt 10#define cellCnt 20
Cells
Cells are defined by a structure:
// The master cell structure ---------------------------------enum modes {hidden,label,input,cancel,okay,toggle,button};
structCELL {int Id;
int Forward;
enum modes Mode;
int Width;
int Height;
int PosX;
int PosY;
bool Selected;
int ButtonClr;
int PaddingWidth;
int PaddingClr;
int SideWidth;
int SideLightClr;
int SideDarkClr;
int FontSize;
char FontName[64];
char Label[32];
} cells[cellCnt];
Note button types or modes are defined in the enum structure.
I have used a grey for my buttons but it is configurable.
Fonts
Fonts are based on what is available under the X11 system. There are 948 fonts on my system but I only bound 18 fonts named in the font alias file. The font alias file is for backward compatibility. The aliases map to real font names.