Re: gtk_widget_destroy(): destroys embedded widgets?



On 5/4/06, Felix Kater <fkater googlemail com> wrote:
if I destroy a container (in my case a gtk table widget), does it automagically remove all widgets which have 
been attached to it before--or do I have to destroy all embedded widgets before one by one?

Short answer: yes, it will automatically destroy all children for you.

Long answer: calling destroy on a widget emits a "destroy" signal. All
widgets which hold a reference to your widget will disconnect and drop
their reference. After the signal has been emitted, the widget will in
turn drop all references to widgets it holds references for. Whenever
a widget loses all references, it is deleted.

Therefore calling destroy on a table will first disconnect the table
from it's parent widget, then delete all child widgets, then delete
the table.



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