The Data Display Control (DDC)
This control will show one table at a time. When given an SQL “select” string, it dynamically generates a CList widget. It is not completely independent of the current project, but it could be with a little work. The code for the DDC is in a separate file, called ddc.c (and, of course, ddc.h). Listing 9.1 is ddc.c .
Listing 9.1. Data Display Control (DDC) Code
#ifdef HAVE_CONFIG_H # include <config.h> #endif #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <string.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> #include <mysql.h> #include "callbacks.h" #include "interface.h" #include "support.h" #include "comm_utils.h" GtkWidget *frm_table_display; GtkWidget *create_ddc (gchar *table_name) ... |
Get MySQL Building User Interfaces now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.