/** xgtkclist.c **/ #include gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data); gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data); static GtkWidget *makeWidget(); int main(int argc,char *argv[]) { GtkWidget *app; GtkWidget *widget; gnome_init("xgtkclist","1.0",argc,argv); app = gnome_app_new("xgtkclist","GtkCList"); gtk_container_set_border_width(GTK_CONTAINER(app),20); gtk_signal_connect(GTK_OBJECT(app),"delete_event", GTK_SIGNAL_FUNC(eventDelete),NULL); gtk_signal_connect(GTK_OBJECT(app),"destroy", GTK_SIGNAL_FUNC(eventDestroy),NULL); widget = makeWidget(); gnome_app_set_contents(GNOME_APP(app),widget); gtk_widget_show_all(app); gtk_main(); exit(0); } gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data) { return(FALSE); } gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data) { gtk_main_quit(); return(0); } static GtkWidget *makeWidget() { GtkWidget *widget; static gchar *titles[] = { "Column 1","Column 2" }; static char *row1[] = { "Apple","Orange" }; static char *row2[] = { "Car","Truck" }; static char *row3[] = { "Airplane","Bird" }; widget = gtk_clist_new_with_titles(2,titles); gtk_clist_append(GTK_CLIST(widget),row1); gtk_clist_append(GTK_CLIST(widget),row2); gtk_clist_append(GTK_CLIST(widget),row3); return(widget); }