strange behaviour of gtk_container_add/remove




    Hi,
    
    first congrats and thanks to GTK team for v1.0. We are finishing 
our own shool project which uses GTK+ (it's an image processing tool -
 completely different from GIMP, similar to Khoros). When switching 
to gtk+-1.0.0 I have noticed a strange behaviour of 
gtk_container_add/remove  when the container is GtkScrolledWindow. 
When I add a GtkPreview to GtkScrolledWindow using:

    gtk_container_add( GTK_CONTAINER( sc_win ), pwin );

it adds pwin to sc_win->viewport. That is correct, but when I use:

    gtk_container_remove( GTK_CONTAINER( sc_win ), pwin ); 

it fails with:

    *WARNING* gtk_container_remove - widget->parent != GTK_WIDGET( 
container)

When looking at the structures in debugger I found that pwin->parent 
is set to sc_win->viewport by gtk_container_add, but 
gtk_container_remove wants it to be set to sc_win... It is OK that 
adding to GtkScrollerWindow adds to viewport, but then removing from 
GtkScrolledWindow should count with it.

Another strange thing I have noticed, but did not have time to 
examine closely, is a seg_fault when displaying GtkPreview (not 
always, but in a special case) on SGI. It seg faults in gdk_flush() 
at BadMatch in calling XSync(). To make it more confusing I run the 
program on solaris and on SGI its only displaying... If I have 
some time (we have to finish it till friday) I will take a closer 
look at this seg_fault. The preview is nested in a table in window...

                                        Hynek




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