예제 #1
0
static void
gtk_xtbin_destroy (GtkObject *object)
{
  GtkXtBin *xtbin;

#ifdef DEBUG_XTBIN
  printf("gtk_xtbin_destroy()\n");
#endif

  g_return_if_fail (object != NULL);
  g_return_if_fail (GTK_IS_XTBIN (object));

  xtbin = GTK_XTBIN (object);

  if(xtbin->xtwindow) {
    /* remove the event handler */
    xt_client_destroy(&(xtbin->xtclient));
    xtbin->xtwindow = 0;

    /* stop X event loop */
    xt_client_xloop_destroy();
  }

  GTK_OBJECT_CLASS(parent_class)->destroy(object);
}
예제 #2
0
static void
gtk_xtbin_destroy (GtkObject *object)
{
  GtkXtBin *xtbin;

#ifdef DEBUG_XTBIN
  printf("gtk_xtbin_destroy()\n");
#endif

  g_return_if_fail (object != NULL);
  g_return_if_fail (GTK_IS_XTBIN (object));

  xtbin = GTK_XTBIN (object);

  if(xtbin->xtwindow) {
    /* remove the event handler */
    xt_client_destroy(&(xtbin->xtclient));
    xtbin->xtwindow = 0;

    num_widgets--; /* reduce our usage count */

    /* If this is the last running widget, remove the Xt display
       connection from the mainloop */
    if (0 == num_widgets) {
#ifdef DEBUG_XTBIN
      printf("removing the Xt connection from the main loop\n");
#endif
      g_main_context_remove_poll((GMainContext*)NULL, &xt_event_poll_fd);
      g_source_remove(tag);

      gtk_timeout_remove(xt_polling_timer_id);
      xt_polling_timer_id = 0;
    }
  }

  GTK_OBJECT_CLASS(parent_class)->destroy(object);
}