/** examine.c **/ #include gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data); gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data); void eventVisibility(GtkWidget *widget, GdkEvent *event,gpointer data); GtkWidget *createLayout(); int main(int argc,char *argv[]) { GtkWidget *app; GtkWidget *button; gnome_init("examine","1.0",argc,argv); app = gnome_app_new("examine","Examine"); gtk_container_set_border_width(GTK_CONTAINER(app),30); 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); button = gtk_button_new_with_label("Button"); gtk_signal_connect(GTK_OBJECT(button),"expose-event", GTK_SIGNAL_FUNC(eventVisibility),NULL); gnome_app_set_contents(GNOME_APP(app),button); gtk_widget_show_all(app); gtk_main(); exit(0); } void eventVisibility(GtkWidget *widget, GdkEvent *event,gpointer data) { int i; printf(" Normal Active Prelight Selected Insensitive\n"); printf(" fg:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->fg[i].pixel); printf("\n bg:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->bg[i].pixel); printf("\n light:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->light[i].pixel); printf("\n dark:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->dark[i].pixel); printf("\n mid:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->mid[i].pixel); printf("\n text:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->text[i].pixel); printf("\n base:"); for(i=0; i<5; i++) printf(" 0x%08lX",widget->style->base[i].pixel); printf("\n\n fg_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->fg_gc[i]); printf("\n bg_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->bg_gc[i]); printf("\nlight_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->light_gc[i]); printf("\n dark_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->dark_gc[i]); printf("\n mid_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->mid_gc[i]); printf("\n text_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->text_gc[i]); printf("\n base_gc:"); for(i=0; i<5; i++) printf(" %p",widget->style->base_gc[i]); printf("\n\nbgpixmap:"); for(i=0; i<5; i++) { if(widget->style->bg_pixmap[i] == NULL) printf(" 0x0000000"); else printf(" %p",widget->style->bg_pixmap[i]); } printf("font: %p\n",widget->style->font); } gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data) { return(FALSE); } gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data) { gtk_main_quit(); return(0); }