static GtkWidget * mug_toolbar (MugData * mugdata) { GtkWidget *toolbar; int i; struct { const char *stock_id; ToolAction action; } tools[] = { {"go-up", ACTION_PREV_MSG}, {"go-down", ACTION_NEXT_MSG}, {NULL, ACTION_SEPARATOR}, {"view-refresh", ACTION_REINDEX}, {NULL, ACTION_SEPARATOR}, {"help-about", ACTION_ABOUT}, {NULL, ACTION_SEPARATOR}, {"application-exit", ACTION_DO_QUIT}}; toolbar = gtk_toolbar_new (); for (i = 0; i != G_N_ELEMENTS (tools); ++i) { if (tools[i].action == ACTION_SEPARATOR) { /* separator? */ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), gtk_separator_tool_item_new (), i); continue; } else /* nope: a real item */ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), get_connected_tool_button (tools[i].stock_id, tools[i].action, mugdata), i); } return toolbar; }
static GtkWidget * mug_toolbar (MugData * mugdata) { GtkWidget *toolbar; int i; struct { const char *stock_id; ToolAction action; } tools[] = { {GTK_STOCK_GO_UP, ACTION_PREV_MSG}, {GTK_STOCK_GO_DOWN, ACTION_NEXT_MSG}, {NULL, ACTION_SEPARATOR}, {GTK_STOCK_REFRESH, ACTION_REINDEX}, {NULL, ACTION_SEPARATOR}, {GTK_STOCK_ABOUT, ACTION_ABOUT}, {NULL, ACTION_SEPARATOR}, {GTK_STOCK_QUIT, ACTION_DO_QUIT}}; toolbar = gtk_toolbar_new (); for (i = 0; i != G_N_ELEMENTS (tools); ++i) { if (tools[i].action == ACTION_SEPARATOR) { /* separator? */ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), gtk_separator_tool_item_new (), i); continue; } else /* nope: a real item */ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), get_connected_tool_button (tools[i].stock_id, tools[i].action, mugdata), i); } return toolbar; }