Add the time left to the menu doesn't sound like a good idea in one regard, as you refreshing the menu every second would be problematic, but having the remaining time as a static value when opening the menu on the 'stop timer' line, does seems like it could be of value.
Should have been 'as refreshing', but yes if the menu is opened, I don't believe its possible to edit its contents and even if it were, there would likely be constant flickering when it did.
#include<gtk/gtk.h>#include<stdio.h>#include<time.h>#define N 30GtkWidget*items[N];intreload_menu(gpointerdata){staticcharbuf[30];for(inti=0;i<N;++i){sprintf(buf,"%d: %d",i,time(NULL));gtk_menu_item_set_label(GTK_MENU_ITEM(items[i]),buf);}returnTRUE;}intmain(intargc,char*argv[]){gtk_init(&argc,&argv);GtkWidget*window=gtk_window_new(GTK_WINDOW_TOPLEVEL);GtkWidget*vbox=gtk_box_new(GTK_ORIENTATION_VERTICAL,0);gtk_container_add(GTK_CONTAINER(window),vbox);GtkWidget*menubar=gtk_menu_bar_new();gtk_box_pack_start(GTK_BOX(vbox),menubar,FALSE,FALSE,0);GtkWidget*fileMi=gtk_menu_item_new_with_label("File");gtk_menu_shell_append(GTK_MENU_SHELL(menubar),fileMi);GtkWidget*fileMenu=gtk_menu_new();gtk_menu_item_set_submenu(GTK_MENU_ITEM(fileMi),fileMenu);for(inti=0;i<N;++i){items[i]=gtk_menu_item_new_with_label("placeholder");gtk_menu_shell_append(GTK_MENU_SHELL(fileMenu),items[i]);}reload_menu(NULL);g_timeout_add(1000,reload_menu,NULL);g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),NULL);gtk_widget_show_all(window);gtk_main();return0;}
You are welcome to fork the project and submit a patch for review. If you don't have fork access, ask for permission on #xfce-dev IRC or the mailing list.