Re: GtkTextBuffer "destroying"



On Sun, 25 Jun 2006 12:49:33 -0700
chuck gilbert <c_gilbert verizon net> wrote:

> I can not seem to destroy a GtkTextBuffer created by calling
> gtk_text_buffer_new.
> To test my problem I used a function like below:
> 
> somefunction()
> {
>  	GtkTextTagTable *tt = gtk_text_tag_table_new();               
>  	GtkTextBuffer *buffer = gtk_text_buffer_new(tt);     
>  	gint n = gtk_text_buffer_get_line_count(buffer);
>  	gtk_widget_destroy(GTK_WIDGET(buffer));
> }
> 
> I have tried to cast "buffer" to G_OBJECT,GTK_TEXT_BUFFER,and GTK_OBJECT
> with no joy.
> 
> At runtime I receive:
>  gtk CRITICAL gtk_widget_destroy assumtion GTK_IS_WIDGET(widget) failed.
> 
> The Buffer is created ie. the line count returns '1'.
> 
> Thanks in advance for any help.
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list

GtkTextBuffer is not a widget, it's a GObject, so you may try with g_object_unref (buffer)

-- 
"Solo due cose sono infinite: l'universo e la stupidità umana... e per quanto riguarda l'universo non sono sicuro"

Albert Einstein

# GnuPG/PGP Key Id: 0x5646B7D4

Attachment: pgpgcyELOqamh.pgp
Description: PGP signature



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