NS_ADDREF(menuItem);
void menu_item_activate_handler(GtkWidget *w, gpointer p){  g_print("menu selected\n");  nsIMenuListener *menuListener = nsnull;  nsIMenuItem *menuItem = (nsIMenuItem *)p;  NS_ADDREF(menuItem);    if (menuItem != NULL) {    nsMenuEvent mevent;    mevent.message = NS_MENU_SELECTED;    mevent.eventStructType = NS_MENU_EVENT;    mevent.point.x = 0;    mevent.point.y = 0;//    mevent.widget = menuItem;    mevent.widget = nsnull;    menuItem->GetCommand(mevent.mCommand);    mevent.mMenuItem = menuItem;    mevent.time = PR_IntervalNow();    nsEventStatus status;    // FIXME - THIS SHOULD WORK.  FIX EVENTS FOR XP CODE!!!!! (pav)//    mevent.widget->DispatchEvent((nsGUIEvent *)&mevent, status);    menuItem->QueryInterface(kIMenuListenerIID, (void**)&menuListener);    if(menuListener) {      menuListener->MenuSelected(mevent);      NS_IF_RELEASE(menuListener);    }  }}