comparison dwt/widgets/Composite.d @ 129:ad4e1fe71a5a

Fixed runtime errors
author Jacob Carlborg <doob@me.com>
date Sun, 18 Jan 2009 18:39:46 +0100
parents c7f7f4d7091a
children
comparison
equal deleted inserted replaced
128:07399639c0c8 129:ad4e1fe71a5a
42 import dwt.widgets.Menu; 42 import dwt.widgets.Menu;
43 import dwt.widgets.Scrollable; 43 import dwt.widgets.Scrollable;
44 import dwt.widgets.ScrollBar; 44 import dwt.widgets.ScrollBar;
45 import dwt.widgets.Shell; 45 import dwt.widgets.Shell;
46 import dwt.widgets.Widget; 46 import dwt.widgets.Widget;
47
48 import tango.io.Stdout;
47 49
48 /** 50 /**
49 * Instances of this class are controls which are capable 51 * Instances of this class are controls which are capable
50 * of containing other controls. 52 * of containing other controls.
51 * <dl> 53 * <dl>
126 public this (Composite parent, int style) { 128 public this (Composite parent, int style) {
127 super (parent, style); 129 super (parent, style);
128 } 130 }
129 131
130 Control [] _getChildren () { 132 Control [] _getChildren () {
133 auto vi = view.id;
131 NSArray views = contentView().subviews(); 134 NSArray views = contentView().subviews();
132 int count = cast(int)/*64*/views.count(); 135 NSUInteger count = views.count();
133 Control [] children = new Control [count]; 136 Control [] children = new Control [count];
134 if (count is 0) return children; 137 if (count is 0) return children;
135 int j = 0; 138 NSUInteger j = 0;
136 for (int i=0; i<count; i++){ 139 for (NSUInteger i=0; i<count; i++){auto o = views.objectAtIndex (count - i - 1).id;
137 Widget widget = display.getWidget (views.objectAtIndex (count - i - 1).id); 140 Widget widget = display.getWidget (views.objectAtIndex (count - i - 1).id);
138 if (widget !is null && widget !is this && cast(Control) widget) { 141 if (widget !is null && widget !is this && cast(Control) widget) {
139 children [j++] = cast(Control) widget; 142 children [j++] = cast(Control) widget;
140 } 143 }
141 } 144 }