Re: how to remove a CanvasWidget from a canvas and put it on another

> I've tried your suggestion however when the canvas is destroyed the  canvasitem
> that is associated with the gtkwidget is destroyed and subsequently performs a
> gtk_widget_destroy() on the gtkwidget. Calling gtk_widget_ref() before destroying
> the canvas doesn't seem to keep the widget from being destroyed along with the
> canvasitem. 

This sounds like a bug. A widget should not be destroyed if there is a ref held
on it.

> The only thing so far that I have found to work is setting the
> gnomecanvasitem->widget to NULL before destroying the canvas. From looking at the
> code for gnome_canvas_widget_destroy() this will work. What I haven't determined
> yet is if there are any side effects from doing this.

If it works, fair enough.
You might have some problems if the canvas attaches any signals that aren't
removed, but I don'tknow if it does or not.


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