bug in gtk_signal_emit_by_name


One of the users of GtkAda as reported a bug in gtk_signal_emit_by_name.
Here is a small test case that reproduces the problem.
Note that apparently the bug is specific to "expose_event", since it does not
appear with other events like "leave".
Let me know if I should report this bug to another mailing list.


/* Compile with :
   gcc `gtk-config --cflags` project2.c `gtk-config --libs`

   This program core dumps when the button is pressed...
   This seems to be because of "expose_event". It works with for instance

#include <gtk/gtk.h>
#include <stdio.h>

on_clicked (GtkObject* obj, GtkDrawingArea draw)
  printf ("on_clicked\n");
  gtk_signal_emit_by_name ((GtkObject*)obj, "expose_event");
  printf ("leave\n");

main (int argc, char *argv[])
  GtkWindow* win;
  GtkButton* button1;

  gtk_init (&argc, &argv);

  win = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
  button1 = (GtkButton*) gtk_button_new_with_label ("button1");
  gtk_container_add ((GtkContainer*)win, (GtkWidget*) button1);

  (void) gtk_signal_connect ((GtkObject*)button1,

  gtk_widget_show_all ((GtkWidget*)win);
  gtk_main ();
  return 1;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]