trouble in destroying gtk_text_buffer (tktext-port)
- From: jflecomte idealx com (Lecomte Jean François)
- To: gtk-app-devel-list gnome org
- Subject: trouble in destroying gtk_text_buffer (tktext-port)
- Date: 02 Apr 2001 19:14:37 +0200
Hi there,
I build a gnome canvas where i put a lot of 
gtk_text_buffer in it, applying some tag on it...
Here is relevant part of the code, which is called many times :
      /*Create a gtk_text_buffer */
      curText = gtk_text_buffer_new(NULL) ;
      gtk_object_ref(GTK_OBJECT(curText));
      /*insert text in it*/  
      gtk_text_buffer_get_iter_at_char(curText, &iter, 0);
      gtk_text_buffer_insert(curText, &iter, content, -1);
      /*Create a tag for this comment*/
      tag = gtk_text_buffer_create_tag(curText, "comment");
      gtk_object_ref(GTK_OBJECT(tag));
      /*Set tag specifications*/        
      gdk_color_parse(item_color[0], &gdkColor);
      gtk_object_set(GTK_OBJECT(tag),
                     "foreground_gdk", &gdkColor,
                     "font", comment_font,
                     NULL);
      
      /*apply tag to buffer*/
      gtk_text_buffer_get_bounds (curText, &start, &end );
      gtk_text_buffer_apply_tag(curText, "comment", &start, &end);
      
       /*Create an tktext canvas with this buffer*/
      item = gnome_canvas_item_new(group,
                                   gnome_canvas_tktext_get_type(),
                                   "x", (gdouble)DEPTHTAB, 
                                   "y", ypos,
                                   NULL);
      gnome_canvas_item_show(item);
      gnome_canvas_tktext_set_buffer(GNOME_CANVAS_TKTEXT(item), curText);
But when i'm trying to destroy the main application, i obtain the following :
Gdk-CRITICAL **: file gdkfont.c: line 219 (gdk_font_unref): assertion `private->ref_count > 0' failed.
GLib-CRITICAL **: file gcache.c: line 160 (g_cache_remove): assertion `node != NULL' failed.
Any idea where i forget something !
Thanks.
-- 
-- 
J-François LECOMTE                      IDEALX S.A.S.
Développeur                             15-17, av. de Ségur
01.44.42.00.00                          F-75007 PARIS
06.67.65.95.09                          http://IDEALX.com/
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]