Re: Deleting random number of buttons...



3saul wrote:

I'm creating some buttons like this


GtkWidget **
add_buttons( GtkWidget *parent, int n )
{
 GtkWidget **buttons = g_new( GtkWidget *, n );

 for( i = 0; i < n ; i++ ) {
   char label[256];

   snprintf( label, 256, "button %d", i );
   buttons[i] = gtk_button_new_with_label( label );
   gtk_contaner_add( GTK_CONTAINER( parent ), buttons[i] );
   gtk_widget_show( buttons[i] );
 }

 return( buttons );
}

How can I delete this buttons once they're created?
They belong to the container once they are added, before that
they are considered "floating" (so when the container is finalized;
so are the buttons).

Cheers,
                           -Tristan




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