Got mysterious problem while setting ui



Hie everybody.

I have got an unresolved problem since two days.

I want to set an ui from an xml file so I have done something like that :


  main_app=bonobo_window_new(PACKAGE, "The Birds Lake");
  ui_container=bonobo_ui_container_new();
  bonobo_ui_container_set_win(ui_container, BONOBO_WINDOW(main_app));
  ui_component=bonobo_ui_component_new(PACKAGE);
  bonobo_ui_component_set_container(ui_component, BONOBO_OBJREF(ui_container));
  bonobo_ui_util_set_ui(ui_component, I_PATH, "tbl-ui.xml", PACKAGE);

But I get this error msg :


Bonobo-CRITICAL **: file bonobo-ui-node.c: line 410 (bonobo_ui_node_to_string):
assertion `doc->xmlRootNode != NULL' failed.
  
  
Getting the source of bonobo, and tracing, here is what I found :

#####################################################################

bonobo_ui_util_set_ui (..)
{ 
  [..]
  if (!cached) {
    node = bonobo_ui_util_new_ui (component, fname, app_datadir, app_name);
    // 2 solutions , node is NULL or node is not NULL
    ui = bonobo_ui_node_to_string (node, TRUE);
  }
} 
1 ) if node is not null

bonobo_ui_node_to_string (..)
{
  [..]
  doc = xmlNewDoc ("1.0");
  g_return_val_if_fail (doc != NULL, NULL);
  // why didn't you insert something like : g_return_val_if_fail(node, NULL);
  doc->xmlRootNode = XML_NODE(bonobo_ui_node_copy (node, TRUE));
  g_return_val_if_fail (doc->xmlRootNode != NULL, NULL); // line 410

  [..]
}

It means the node could not be copied ? Why ?

2) if node is NULL

bonobo_ui_util_new_ui (..)
{
  [..]
  node = bonobo_ui_node_from_file (file_name);
  [..]
}

bonobo_ui_node_from_file (..)
{
  [..]
  bonobo_ui_node_strip (&node);
  [..]
}

bonobo_ui_node_strip (..)
{
  [..]
  // making a lot of freeing operations, maybe too much
}
#####################################################################


What's really surprising is that the same code but used alone in a mini
project works perfectly !

Did someone already had this problem. What are the solutions ?

Thank you for help.


*** mist



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