From 2514d47146b3f92608aea4213df3b51d052c0987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Mon, 17 Oct 2011 20:18:56 +0000 Subject: [PATCH] [GB.GTK] * BUG: Container.Children.Clear() should work correctly now. git-svn-id: svn://localhost/gambas/trunk@4205 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/CContainer.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gb.gtk/src/CContainer.cpp b/gb.gtk/src/CContainer.cpp index 13dfbae24..253ddaee7 100644 --- a/gb.gtk/src/CContainer.cpp +++ b/gb.gtk/src/CContainer.cpp @@ -117,11 +117,16 @@ END_PROPERTY BEGIN_METHOD_VOID(ContainerChildren_Clear) gContainer *cont = WIDGET->proxyContainer(); - int i; + gControl *child; + + for(;;) + { + child = cont->child(0); + if (!child) + break; + child->destroy(); + } - for (i = 0; i < cont->childCount(); i++) - cont->child(i)->destroy(); - END_METHOD