alternative to assert
[gtkD.git] / gtkD / demos / gtkD / TestText.d
blob34cc5205282159fab9e6f2385b47b9a0d4564a71
1 /*
2 * This file is part of gtkD.
3 *
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
8 *
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 module gtkD.TestText;
21 private import gtk.VBox;
23 private import gtk.ScrolledWindow;
24 private import gtk.TextView;
25 private import gtk.TextBuffer;
27 /**
28 * This tests the GtkD text widget
31 class TestText : VBox
34 private import gtk.ScrolledWindow;
35 private import gtkc.gtktypes;
37 this()
40 super(false,0);
42 debug(1)
44 printf("instantiating TestText\n");
47 ScrolledWindow sw = new ScrolledWindow(null, null);
48 sw.setPolicy(PolicyType.AUTOMATIC,PolicyType.AUTOMATIC);
50 TextView textView = new TextView();
51 TextBuffer textBuffer = textView.getBuffer();
52 textBuffer.setText(
54 "\nDUI version 00.01 build 30"
55 "\n"
56 "\n00.01_30"
57 "\nIntroduction"
58 "\nDUI is a D language graphical user interface based on GKT+ graphical toolkit"
59 "\nDUI stands for D graphical User Interface"
60 "\nDUI is in a very early state of development and should be considered in alpha state."
61 "\nDUI is released under the GPL license"
62 "\nTo discuss about DUI:"
63 "\n"
64 "\n * if it's D related or can have interest to other D user please use the D discussion group at"
65 "\n Digital Mars D news group"
66 "\n * if it's a DUI issue with no insterest to other D user please use the yahoo group"
67 "\n gtkDoolkit yahoo group"
68 "\n * if you want to send a private message to the author please fill free to do so at"
69 "\n gtkDoolkit guy"
70 "\n"
71 "\nObjectives"
72 "\nThe main goal of DUI is to enable the creation of D GUI applications under Linux."
73 "\nDUI should be simple and straightforward to use."
74 "\nD can interface with C so any graphics toolkit with a C API can be used directly from D, this include GTK+."
75 "\nDownload and Status"
76 "\nfor now DUI can display most of the GTK+ widgets and respond to the common user actions"
77 "\nDUI is still of little use but you can get it on the Download and Status."
78 "\nUsage"
79 "\nSee the Screen shots and Usage for screenshots and details on how to use DUI."
80 "\nHere is a simple DUI program:"
84 sw.add(textView);
85 packStart(sw,true,true,0);