gtk_notebook_insert_page Gtk-CRITICAL errors ....

Hi All with thanks to Iago

Thank - got it yesterday....

Another issue with notebook

My project is compiling and running fine except for some Gtk-CRITICAL
runtime error/warnings - whatever they r addressed as..i address them
as warnings in this email

5 of my 7 warnings are traced to this call in every page of the notebook

gtk_notebook_insert_page(notebook, ntable, label, 0);

I am not able to understand the error here.....

the warning is as below:
Gtk-CRITICAL **: file gtkwidget.c: line 3817 (gtk_widget_set_parent):
assertion `widget->parent == NULL' failed

Can anyone throw any pointers to the warning...

Thanks again


On Tue, 02 Nov 2004 09:27:04 +0100, Iago Rubio <iago rubio hispalinux es> wrote:
On Tue, 2004-11-02 at 03:35, Vinod Joseph wrote:
Hi Iago

Could you tell me how to obtain the page_num effectively..

The issue is GTK writes only on gtk_main and your page number is
always the maximum number of pages....

Yes sorry use:
gint gtk_notebook_get_current_page   (GtkNotebook *notebook);

So...only the last page settings are effective on giving the
if ( gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)-1)
 { do this controls for the other pages...etc }
else if {
 do controls for LAST PAGE

My fault.

Here the logic for controls is simplified to differentiate only last page...

But, only LAST PAGE controls work...bcoz on gtk_main() call - the
number of pages is the total value and my number is all even
numbers....2/4/6/8 for 4 actual pages..

Just add a check for the page number at function's start -
cur_pages = gtk_notebook_get_current_page(notebook); - and replace
"page_num"  with "cur_pages" in the function's body.

Thank you for your assistance

You're welcome.


On Mon, 01 Nov 2004 16:20:31 +0100, Iago Rubio <iago rubio hispalinux es> wrote:
On Mon, 2004-11-01 at 09:58, Vinod Joseph wrote:
Hi David

My controls are outside the notebook widget..

Design as shown in attached text file

But i am not able to correctly disable or unrealize widgets for a
particular page in notebook....

Use the notebook's "switch-page" signal and gtk_widget_set_sensitive()
or g_object_set().


typedef struct _TheButtons {
       GtkWidget* button_next;
       GtkWidget* button back;
} TheButtons;

void create_notebook()

TheButtons* buttons = g_malloc0(sizeof(TheButtons));

// create the notebook
// create the buttons namely back and next in this example

buttons->button_next = back;
buttons->button_back = next;

g_signal_connect(G_OBJECT(notebook), "switch-page",

g_signal_connect_swapped(G_OBJECT(notebook), "destroy",


notebook_page_switched(GtkNotebook *notebook,
                      GtkNotebookPage *page,
                      guint page_num,
                      gpointer user_data)
 TheButtons* buttons;
 buttons = (TheButtons*) user_data;
 gboolean issensitive;

 if( page_num == 0){
     "sensitive", FALSE, NULL);
     "sensitive",&issensitive, NULL);
   if( !issensitive ){
       "sensitive", TRUE, NULL);
 if( page_num ==
   (gtk_notebook_get_num_pages(notebook) - 1) ){
     "sensitive", FALSE, NULL);

     "sensitive",&issensitive, NULL);
   if( !issensitive ){
       "sensitive", TRUE, NULL);

It's quick written from memory so it can contain errors.
Iago Rubio

Iago Rubio

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