Ejemplo n.º 1
0
static void destroyFunc( GtkWidget *widget, gpointer data )
{
   CanvasParams *p = (CanvasParams *)data;
   GPtrArray    *items;

   gnoclForgetWidgetFromName( p->name );
   Tcl_DeleteCommand( p->interp, p->name );

   g_free( p->name );
   /*  TODO: the canvas receives the destroy signal before its items. But
             the items use the hash table on destruction.
             Shouldn't children receive the signal before their parents?
             Hmm, GTK widgets do it the same way.  
             gtk_container_foreach( GTK_CONTAINER( widget ), 
                   (GtkCallback)destroyItemFunc, NULL);  
             doesn't help either

   */
   items = gnoclCanvasAllItems( p );
   if( items != NULL )
   {
      int k;
      for( k = items->len - 1; k >= 0; --k )
      {
         Gnocl_CanvasItemInfo *info = GET_INFO( items, k );
         gtk_object_destroy( GTK_OBJECT( info->item ) );
      }
   }
   g_hash_table_destroy( p->tagToItems ); 
}
Ejemplo n.º 2
0
static void destroyFunc( GtkWidget *widget, gpointer data )
{
   ComboParams *para = (ComboParams *)data;
   gnoclAttacheOptCmdAndVar( 
         NULL, &para->onChanged, 
         NULL, &para->variable, 
         "changed", getSigObj( para->comboBox ), 
         G_CALLBACK( changedFunc ), para->interp, traceFunc, para );
   gnoclForgetWidgetFromName( para->name );
   Tcl_DeleteCommand( para->interp, para->name );
   
   g_free( para->variable );
   g_free( para->onChanged );
   g_free( para->name );
   g_free( para );
}
Ejemplo n.º 3
0
static void spinButtonDestroyFunc ( GtkWidget *widget, gpointer data )
{
   SpinButtonParams *para = (SpinButtonParams *)data;

   gnoclForgetWidgetFromName( para->name );
   Tcl_DeleteCommand( para->interp, para->name );

   gnoclAttacheOptCmdAndVar( NULL, &para->onValueChanged,
         NULL, &para->variable,
         "changed", G_OBJECT( para->spinButton ), G_CALLBACK( changedFunc ),
         para->interp, traceFunc, para );

   g_free( para->variable );
   g_free( para->name );
   g_free( para );
}
Ejemplo n.º 4
0
Archivo: label.c Proyecto: zdia/gnocl
/**
\brief
\author     Peter G Baum, William J Giddings
\date
**/
static void destroyFunc (
	GtkWidget *widget,
	gpointer data )
{
#ifdef DEBUG_LABEL
	printf ( "label/staticFuncs/destroyFunc\n" );
#endif


	LabelParams *para = ( LabelParams * ) data;

	gnoclForgetWidgetFromName ( para->name );
	Tcl_DeleteCommand ( para->interp, para->name );

	gnoclAttacheOptCmdAndVar (
		NULL, &para->onChanged,
		NULL, &para->textVariable,
		"changed", G_OBJECT ( para->label ),
		G_CALLBACK ( changedFunc ), para->interp, traceFunc, para );

	g_free ( para->textVariable );
	g_free ( para->name );
	g_free ( para );
}