Re: [gtk-list] Reparenting bug




As the well-known Havoc recently told me, gtk_widget_reparent is an
internal function, and shouldn't be called from application code.  Perhaps
gtk_container_remove()/gtk_container_add() would work the way you
expected....

Best, --josh

----------------------------------------------------------------
                       Joshua Richardson
Dept. Cognitive and Neural Systems / Center for Adaptive Systems
                       Boston University
----------------------------------------------------------------

On Thu, 22 Jul 1999, Conrad Steenberg wrote:

> Hi all
> 
> I think I found a bug in the reparenting of widgets. Is there a better
> place to post this? This is with gtk+-1.2.3-1 on RedHat 6.0 on an Alpha.
> 
> My app has a spinbutton inside a table that I want to reparent.
> When I reparent the table and put it into a new window, all is fine. 
> When I reparent the table again, putting it in its previous place, the up
> and down buttons of the spinbutton remains in the second window.
> 
> All the other widgets in the table are displayed just fine.
> 
> The code that does this is inside the signal-handler of a toggle button,
> and goes roughly like this:
> 
> void reparent_clicked (GtkToggleButton *button,
>                   GtkWidget *table)
> { GtkWidget *window;
> 
>   if (button->active)
>    {  window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>       gtk_window_set_title (GTK_WINDOW (window), "New window");
>       gtk_widget_reparent(table,window);
>       gtk_widget_show(window);
>     }
>   else
>     { window=table->parent;
>       gtk_widget_reparent(table,notebook);
>       gtk_widget_destroy(window);
>     }
> }
> 
> The original parent of the table was a notebook.
> 
> Can anybody shed some light on this?
> 
> Cheers
> 
> Conrad
> 
> *-----------------------------------------*                                  
> | Conrad Steenberg                        |                                  
> | Caltech, Mail Code 220-47               |                                  
> | Pasadena, CA, 91125                     |                                  
> | e-mail: conrad@srl.caltech.edu          |                                  
> | Tel: (626) 395-2964 Fax: (626) 449-8676 |                                  
> *-----------------------------------------*                                  
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 



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