gtk_text_buffer_insert() cause fault.



Title: gtk_text_buffer_insert() cause fault.

After cross-compiling all the gtk+2.2 related things for my iPAQ, I can run all test applications in the examples directory except 'paned'. When I run 'paned' I got following errors.

# ./paned
Gtk-ERROR **: file gtktextdisplay.c: line 237 (get_shape_extents): should not be reached
aborting...
Aborted

I tried to find what cause the error in the paned.c program and
I found that gtk_text_buffer_inser() cause that error. When I remove that line, it works well.

void insert_text (GtkTextBuffer *buffer)
{
   GtkTextIter iter;
 
   gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
   gtk_text_buffer_insert (buffer, &iter,               // <-- this cause error.
    "From: pathfinder nasa gov\n"
    " -Path\n", -1);
  
}
 
Then I tried to see  gtktextdisplay.c of gtk source tree and I found that PangoAttribute *attr value is 0.

static void
get_shape_extents (PangoLayoutRun *run,
                   PangoRectangle *ink_rect,
                   PangoRectangle *logical_rect)
{
  GSList *tmp_list = run->item->analysis.extra_attrs;

  while (tmp_list)
    {
      PangoAttribute *attr = tmp_list->data; // <-- *attr = 0. That's the problem.
      if (attr->klass->type == PANGO_ATTR_SHAPE)
        {
        ..
        }
      tmp_list = tmp_list->next;
    }
  g_assert_not_reached ();      // <- reach here. because *attr = 0.
}

As I'm new to gtk, I have no idea what this function is. I hope some advise to resolve this problem. Any hint or comment will be very thankful.

-
HeeChul Yun,         
Embedded S/W Team at ETRI
phone: +82-42-860-1673



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