/** showstock.c **/ #include gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data); gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data); gchar *stock[] = { GNOME_STOCK_PIXMAP_NEW, GNOME_STOCK_PIXMAP_OPEN, GNOME_STOCK_PIXMAP_CLOSE, GNOME_STOCK_PIXMAP_REVERT, GNOME_STOCK_PIXMAP_SAVE, GNOME_STOCK_PIXMAP_SAVE_AS, GNOME_STOCK_PIXMAP_CUT, GNOME_STOCK_PIXMAP_COPY, GNOME_STOCK_PIXMAP_PASTE, GNOME_STOCK_PIXMAP_CLEAR, GNOME_STOCK_PIXMAP_PROPERTIES, GNOME_STOCK_PIXMAP_PREFERENCES, GNOME_STOCK_PIXMAP_HELP, GNOME_STOCK_PIXMAP_SCORES, GNOME_STOCK_PIXMAP_PRINT, GNOME_STOCK_PIXMAP_SRCHRPL, GNOME_STOCK_PIXMAP_SEARCH, GNOME_STOCK_PIXMAP_BACK, GNOME_STOCK_PIXMAP_FORWARD, GNOME_STOCK_PIXMAP_FIRST, GNOME_STOCK_PIXMAP_LAST, GNOME_STOCK_PIXMAP_HOME, GNOME_STOCK_PIXMAP_STOP, GNOME_STOCK_PIXMAP_REFRESH, GNOME_STOCK_PIXMAP_UNDO, GNOME_STOCK_PIXMAP_REDO, GNOME_STOCK_PIXMAP_TIMER, GNOME_STOCK_PIXMAP_TIMER_STOP, GNOME_STOCK_PIXMAP_MAIL , GNOME_STOCK_PIXMAP_MAIL_RCV, GNOME_STOCK_PIXMAP_MAIL_SND, GNOME_STOCK_PIXMAP_MAIL_RPL, GNOME_STOCK_PIXMAP_MAIL_FWD, GNOME_STOCK_PIXMAP_MAIL_NEW, GNOME_STOCK_PIXMAP_TRASH, GNOME_STOCK_PIXMAP_TRASH_FULL, GNOME_STOCK_PIXMAP_UNDELETE, GNOME_STOCK_PIXMAP_SPELLCHECK, GNOME_STOCK_PIXMAP_MIC, GNOME_STOCK_PIXMAP_LINE_IN, GNOME_STOCK_PIXMAP_CDROM, GNOME_STOCK_PIXMAP_VOLUME, GNOME_STOCK_PIXMAP_MIDI, GNOME_STOCK_PIXMAP_BOOK_RED, GNOME_STOCK_PIXMAP_BOOK_GREEN, GNOME_STOCK_PIXMAP_BOOK_BLUE, GNOME_STOCK_PIXMAP_BOOK_YELLOW, GNOME_STOCK_PIXMAP_BOOK_OPEN, GNOME_STOCK_PIXMAP_ABOUT, GNOME_STOCK_PIXMAP_QUIT, GNOME_STOCK_PIXMAP_MULTIPLE, GNOME_STOCK_PIXMAP_NOT, GNOME_STOCK_PIXMAP_CONVERT, GNOME_STOCK_PIXMAP_JUMP_TO, GNOME_STOCK_PIXMAP_UP, GNOME_STOCK_PIXMAP_DOWN, GNOME_STOCK_PIXMAP_TOP, GNOME_STOCK_PIXMAP_BOTTOM, GNOME_STOCK_PIXMAP_ATTACH, GNOME_STOCK_PIXMAP_INDEX, GNOME_STOCK_PIXMAP_FONT, GNOME_STOCK_PIXMAP_EXEC, GNOME_STOCK_PIXMAP_ALIGN_LEFT, GNOME_STOCK_PIXMAP_ALIGN_RIGHT, GNOME_STOCK_PIXMAP_ALIGN_CENTER, GNOME_STOCK_PIXMAP_ALIGN_JUSTIFY, GNOME_STOCK_PIXMAP_TEXT_BOLD, GNOME_STOCK_PIXMAP_TEXT_ITALIC, GNOME_STOCK_PIXMAP_TEXT_UNDERLINE, GNOME_STOCK_PIXMAP_TEXT_STRIKEOUT, GNOME_STOCK_PIXMAP_TEXT_INDENT, GNOME_STOCK_PIXMAP_TEXT_UNINDENT, GNOME_STOCK_PIXMAP_EXIT, GNOME_STOCK_PIXMAP_COLORSELECTOR, GNOME_STOCK_PIXMAP_ADD, GNOME_STOCK_PIXMAP_REMOVE, GNOME_STOCK_PIXMAP_TABLE_BORDERS, GNOME_STOCK_PIXMAP_TABLE_FILL, GNOME_STOCK_PIXMAP_TEXT_BULLETED_LIST, GNOME_STOCK_PIXMAP_TEXT_NUMBERED_LIST }; static GnomeUIInfo iconInfo = { GNOME_APP_UI_ITEM,NULL,NULL,NULL,NULL,NULL, GNOME_APP_PIXMAP_STOCK,NULL,0,0,NULL }; static GnomeUIInfo endInfo = GNOMEUIINFO_END; static GnomeUIInfo toolbarInfo[10]; int main(int argc,char *argv[]) { int s; int t; int count; int total_size; GtkWidget *app; gnome_init("showstock","1.0",argc,argv); app = gnome_app_new("showstock", "Gnome Stock Icons"); 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); total_size = sizeof(stock)/sizeof(gchar *); s = 0; while(s < total_size) { for(t=0, count=0; count<9; t++, count++) { memcpy(&toolbarInfo[t], &iconInfo,sizeof(iconInfo)); toolbarInfo[t].label = stock[s]; toolbarInfo[t].pixmap_info = stock[s]; memcpy(&toolbarInfo[t+1], &endInfo,sizeof(endInfo)); if(strlen(stock[s]) > 12) count++; if(++s >= total_size) break; } gnome_app_create_toolbar(GNOME_APP(app), toolbarInfo); 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); }