1 #!/usr/bin/env dub 2 /+ 3 dub.sdl: 4 name "snippet_many_widgets" 5 dependency "dwt" path="../../../../../../" 6 stringImportPaths "../../../../../res" 7 libs \ 8 "atk-1.0" \ 9 "cairo" \ 10 "dl" \ 11 "fontconfig" \ 12 "gdk-x11-2.0" \ 13 "gdk_pixbuf-2.0" \ 14 "glib-2.0" \ 15 "gmodule-2.0" \ 16 "gnomeui-2" \ 17 "gnomevfs-2" \ 18 "gobject-2.0" \ 19 "gthread-2.0" \ 20 "gtk-x11-2.0" \ 21 "pango-1.0" \ 22 "pangocairo-1.0" \ 23 "X11" \ 24 "Xcomposite" \ 25 "Xcursor" \ 26 "Xdamage" \ 27 "Xext" \ 28 "Xfixes" \ 29 "Xi" \ 30 "Xinerama" \ 31 "Xrandr" \ 32 "Xrender" \ 33 "Xtst" \ 34 platform="linux" 35 +/ 36 37 /** 38 * Author: kntroh 39 * License: CC0(http://creativecommons.org/publicdomain/zero/1.0/) 40 */ 41 module org.eclipse.swt.snippets.SnippetManyWidget; 42 43 /** 44 * This program snippet is a test for many widgets creation on GTK. 45 */ 46 import org.eclipse.swt.all; 47 48 void main() { 49 auto d = new Display; 50 auto s = new Shell(d); 51 52 foreach (i; 0 .. 4097) { 53 new Label(s, SWT.NONE); 54 } 55 56 s.open(); 57 while (!s.isDisposed()) { 58 if (!d.readAndDispatch()) { 59 d.sleep(); 60 } 61 } 62 d.dispose(); 63 } 64