On Sat, 2008-03-22 at 11:49 -0500, nisha jain wrote:
> Hi All,
>  
> I have used pthread in my application and Hildon APIs for the GUI.
>  
> In my application the main() is used for the GUI and pthread for
> communication.
>  
> I am getting following run time exception some times while running
> number of times...
>  
> Though i am not able to identify the cause... 
>  
>  
> N800App[2455]: GLIB CRITICAL ** Gtk - gtk_box_pack_start: assertion
> `child->parent == NULL' failed
>  
> Please let me know if some one has any idea about it?

You'd get this error when trying to pack a widget into a Gtk[VH]Box when
that widget is already contained (i.e. it has a parent). To re-pack a
widget, you need to g_object_ref it, (assuming you don't hold a
reference), remove it from its container (gtk_container_remove) and then
you'll be able to pack it into the box successfully (remember to unref
afterwards).

Also note, GTK is not thread-safe, so GTK functions mustn't be called
outside of the main thread. You can use gdk_threads_enter/leave, but
it's generally easier to use idle callbacks (if you g_idle_add in a
thread, the callback will happen in the thread of the mainloop, as
opposed to whatever thread you called it from).

Hope that helps!

--Chris



_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to