gtk_container_remove - issues



Hello,
Continuing on the thread in this list (as suggested by one of the 
contributors).

I've got a sample code below that produced the problem.
(As suggested by John Cupitt)

There is probably something simple I'm doing wrong.

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

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);
}


ERROR message , when pressing the button.

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

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


Note how I've removed the textview.

I will try one or two of the other suggestions.

Cheers!

Joe




-- 



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