gtk_timeout problem



Currently I am building an application which will require a window refresh 
every x amount of time so I thought I would use the function call 
gtk_timeout_add.  However, I am getting a core dump after x amount of 
seconds/time is over.  The timeout seems to work since the application 
seems to run until the timeout specified but then the application crashes 
and I get a core dump.  I am probabaly doing something ignorant since I am 
not real familiar with this function. Below is some code that should 
exemplify my problem:

void test_select(GtkWidget *widget, gpointer display_tasks)
{
  int timeperiod;
  timeperiod = 
gtk_timeout_add(10000,(GtkFunction)select_all,display_tasks);
}

This function should call my function select_all every 10000 ms or I guess 
about 10 seconds.

void select_all(GtkWidget *widget, gpointer display_tasks)
{
  printf("select all \n\n");
  gtk_clist_select_all(GTK_CLIST(display_tasks));
}

The callback in main () for this is when a certain pushbutton gets pushed 
and calls 'test_select'.  The reason i have an 'empty' function which has 
test_select call select_all is so I don't cause infinite recursion or is 
that not an issue with gtk.

gtk_signal_connect(GTK_OBJECT(all_tasks),"clicked",
                             test_select,GTK_CLIST(display_tasks));





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