Date: Sunday November 25, 2001 @ 15:47 Author: cameron Update of /home/netrek/cvsroot/Vanilla/gum In directory swashbuckler.real-time.com:/var/tmp/cvs-serv22977 Modified Files: signals.c Log Message: add comments **************************************** Index: Vanilla/gum/signals.c diff -u Vanilla/gum/signals.c:1.7 Vanilla/gum/signals.c:1.8 --- Vanilla/gum/signals.c:1.7 Tue May 1 21:00:18 2001 +++ Vanilla/gum/signals.c Sun Nov 25 15:47:33 2001 @@ -62,9 +62,10 @@ #include "sysdefaults.h" #include "solicit.h" +/* pointers to the top level widgets we will manage */ GtkWidget *gummain, *gumopen, *gumsaveas, *gummotd; -#define MAXLINES 2048 +#define MAXLINES 2048 /* maximum size of input file */ static char *lines[MAXLINES]; /* array of lines in input file */ static int keys[MAXLINES]; /* links from lines to keywords */ static int defs[MAXLINES]; /* links from keywords to lines */ @@ -75,6 +76,10 @@ guint context; } statusbar; +/* replacement for Glade's lookup_widget that operates silently, so +that we can have options added to configuration without a widget yet +existing, and so that the code can check for the existence of a widget +without errors being displayed. */ GtkWidget* widgie (GtkWidget *widget, gchar *widget_name) @@ -88,7 +93,7 @@ return found_widget; } - +/* given a title and a message text, pop up a message dialog */ void message ( char *title, char *text ) { GtkWidget *w, *x; @@ -99,8 +104,8 @@ gtk_label_set (GTK_LABEL(x), text); gtk_widget_show (w); } - +/* set a widget to a specific value or state */ int setwidget ( char *key, char *value, int state ) { GtkWidget *w; @@ -156,8 +161,8 @@ return g_list_position (menu->children, (GList *) child); } */ - +/* get a widget value, assuming a scalar parameter */ char *getwidget_scalar ( char *key ) { static char result[128]; @@ -214,6 +219,7 @@ return ""; } +/* get a widget value, for an array parameter type */ char *getwidget_array (struct sysdef_keywords *sk) { int k; @@ -237,6 +243,7 @@ return result; } +/* given a keyword, obtain the current widget value */ char *getwidget (struct sysdef_keywords *sk) { switch (sk->type) { @@ -255,6 +262,7 @@ return ""; } +/* set the labels on the widgets */ void setlabels ( ) { int i;