xref: /haiku/src/tests/add-ons/print/ppd/ui/UIUtils.cpp (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2008, Haiku.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		Michael Pfeiffer <laplace@users.sourceforge.net>
7  */
8 
9 #include "UIUtils.h"
10 
11 void MakeEmpty(BListView* list)
12 {
13 	if (list != NULL) {
14 		BListItem* item;
15 		while ((item = list->RemoveItem((int32)0)) != NULL) {
16 			delete item;
17 		}
18 	}
19 }
20 
21 void RemoveChildren(BView* view)
22 {
23 	if (view != NULL) {
24 		BView* child;
25 		while ((child = view->ChildAt(0)) != NULL) {
26 			child->RemoveSelf();
27 			delete child;
28 		}
29 	}
30 }
31 
32