Hi , try this:

1) while connecting the signal (on main function, I don't know), pass
the "notebook" widget as a "user pointer" argument ... something like
that :

        gtk_signal_connect(GTK_OBJECT(my_button), "clicked",
GTK_SIGNAL_FUNC(close_current_tab_cb), my_notebookPointer);

2) on callback:

static void close_current_tab_cb (GtkButton *button, GPointer *notebook)
{
        gint current_page, num_pages;
        
        num_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
        
        if (num_pages >1) {
        
                current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK 
(notebook));
        
                gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), 
current_page);
                num_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));

        }
}

if you don't wanna ensure at least one tab always opened in your app,
just remove the  "if (num_pages >1) {"   ... piece of code ..

Regards

-- 
Antonio Gomes
E-mail: [EMAIL PROTECTED]
Embedded Linux Lab - 10LE
INdT - Instituto Nokia de Tecnologia (Manaus/Br)
NOKIA's Technology Institute
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to