Re: treeview---->cursor-changed--->destroy---->seg fault



On Monday 13 September 2004 16:07, P V Mathew wrote:

void my_signal(GtkTreeView *t,gpointer g)
{
        static int n=1;
        if (n != 1)
        {
        fprintf(stderr,"%s\n","signal received");
                n = 1;
                gtk_widget_destroy(((struct allv*)g)->win);
                //MainWindow();
        }
        else
                n++;
}

Just don't do it in the signal callback itself, but rather use something like:

static gboolean
destroy_treeview (gpointer w)
{
  gtk_widget_destroy (GTK_WIDGET (w));
  return FALSE; /* don't call again */
}

void 
my_signal (GtkTreeView *t,gpointer g)
{
  g_idle_add (destroy_treeview, ((struct allv*)g)->win);
}


Cheers 
-Tim


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