gtk_container remove - sheet (cont'd)



Hello, 
I was previously writing this thread in the gtk-devel-list. One of the 
contributors suggested this list instead.

Ok,
As per John's suggestion I've tried writing some simplfied code.


#include <gtk/gtk.h>
#include <gtkextra/gtksheet.h>

void my_destroy( GtkWidget *child )
{
  g_print("my_destroy: destroying a %s\n", G_OBJECT_TYPE_NAME (child));
  gtk_widget_destroy (child);
}

int close_it(GtkWidget *but, GtkWidget *shet)
{
 gtk_widget_destroy(shet);
}

int main ( int argc, char *argv[])
{    
GtkWidget *window;
GtkWidget *sheet;
GtkWidget *scrolled_window;
GtkWidget *vbox;
GtkTextBuffer *buffer;
GtkWidget *button;

gtk_init (&argc, &argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
scrolled_window=gtk_scrolled_window_new(NULL, NULL); 
gtk_container_add (GTK_CONTAINER (window), scrolled_window); 


button = gtk_button_new();

vbox = gtk_vbox_new(TRUE, 1);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), vbox);

sheet=gtk_sheet_new(3,11,"Edit table"); 
gtk_sheet_set_autoresize(GTK_SHEET(sheet), TRUE);                            


gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(vbox), sheet, FALSE, TRUE, 0);

g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (close_it), sheet);


gtk_widget_show_all(window);


gtk_main();
return(0);
}

I have managed to get rid of the textview, same error. Something in the destroy of the
sheet isn't happening right.


(sheet:15927): Gtk-CRITICAL **: file gtkwidget.c: line 6997 (gtk_widget_get_clipboard): assertion 
`gtk_widget_has_screen (widget)' failed

(sheet:15927): Gtk-CRITICAL **: file gtkclipboard.c: line 575 (gtk_clipboard_get_owner): assertion `clipboard 
!= NULL' failed


I'm going to continue to look into this, this evening.

Only thing that comes to mind, is that some handler is connected and is fired 
during the destroy of the sheet, or there is something wrong with the destroy
of the widget.

Any ideas?


Cheers

Joe



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