Implementing A Timer To Callback From gtk_main()


#include <gtk/gtk.h>
#include <time.h>
Create the timer

  g_timeout_add(1000, (GSourceFunc) timer_event, (gpointer) MainWindow);  //Register the timer and set time in mS. The timer_event() function is called repeatedly until it returns FALSE. 
  gtk_widget_show_all(MainWindow);
  timer_event(MainWindow);				//Call the timer function now if you don't want to wait for the first time period triggered call 

  gtk_main();
The function called


//*********************************
//*********************************
//********** TIMER EVENT **********
//*********************************
//*********************************
static gboolean timer_event(GtkWidget *widget)
{


  

  return TRUE;
}