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 3 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. 13 * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 17 */ 18 19 module TestText; 20 21 private import gtk.VBox; 22 23 private import gtk.ScrolledWindow; 24 private import gtk.TextView; 25 private import gtk.TextBuffer; 26 27 debug import std.stdio; 28 29 /** 30 * This tests the GtkD text widget 31 */ 32 33 class TestText : VBox 34 { 35 36 private import gtk.ScrolledWindow; 37 38 this() 39 { 40 41 super(false,0); 42 43 debug(1) 44 { 45 writeln("instantiating TestText"); 46 } 47 48 ScrolledWindow sw = new ScrolledWindow(null, null); 49 sw.setPolicy(PolicyType.AUTOMATIC,PolicyType.AUTOMATIC); 50 51 TextView textView = new TextView(); 52 TextBuffer textBuffer = textView.getBuffer(); 53 textBuffer.setText( 54 55 "\nGktD 56 57 Introduction 58 GtkD is a D language graphical user interface based on GKT+ graphical toolkit 59 GtkD is released under the GPL license 60 To discuss about GtkD: 61 62 * if it's D related or can have interest to other D user please use the D discussion group at 63 Digital Mars D news group 64 * if it's a GtkD issue with no insterest to other D user please use the GtkD forum 65 on gtkd.org 66 67 Objectives 68 The main goal of GtkD is to enable the creation of D GUI applications under Linux. 69 GtkD should be simple and straightforward to use. 70 D can interface with C so any graphics toolkit with a C API can be used directly from D, this include GTK+." 71 72 ); 73 74 sw.add(textView); 75 packStart(sw,true,true,0); 76 77 } 78 79 }