NS_ADDREF(NS_STATIC_CAST(nsIWidget*,win));
NS_ADDREF(win);
gint handle_key_press_event_for_text(GtkObject *w, GdkEventKey* event,                                     gpointer p){  nsKeyEvent kevent;  nsTextWidget* win = (nsTextWidget*)p;  // work around for annoying things.  if (event->keyval == GDK_Tab)    if (event->state & GDK_CONTROL_MASK)      if (event->state & GDK_MOD1_MASK)        return PR_FALSE;  // Don't pass shift, control and alt as key press events  if (event->keyval == GDK_Shift_L      || event->keyval == GDK_Shift_R      || event->keyval == GDK_Control_L      || event->keyval == GDK_Control_R)    return PR_TRUE;  NS_ADDREF(NS_STATIC_CAST(nsIWidget*,win));  InitKeyEvent(event, p, kevent, NS_KEY_DOWN);  win->OnKey(kevent);  //  // Second, dispatch the Key event as a key press event w/ a Unicode  //  character code.  Note we have to check for modifier keys, since  // gtk returns a character value for them  //  InitKeyPressEvent(event,p, kevent);  win->OnKey(kevent);  NS_RELEASE(NS_STATIC_CAST(nsIWidget*,win));  if (w)  {    gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_press_event");  }  return PR_TRUE;}