GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlignmentTest.C
Go to the documentation of this file.
1 /* Copyright 2000-2013 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream 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 General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16  */
17 /* Compile with ...
18 g++ -ggdb `gtk-config --cflags` LabelsTest.C -o LabelsTest `gtk-config --libs`
19 */
20 #include "gtkInterface.H"
21 #include "Labels.H"
22 #include "Box.H"
23 #include "Buttons.H"
24 #include "Alignment.H"
25 
26 static void quit(void *wid, gpointer data){
27  gtk_main_quit();
28 }
29 
30 int main(int argc, char *argv[]){
31 
32  gtk_init( &argc, &argv );
33 
34  GtkInterface topWindow;
35 
36  Buttons buttons;
37  buttons<<BUTTONLABELSTRUCT("Quit", quit, NULL);
38 
39  Labels labs;
40  labs<<(const char*)"this label \nis centrally aligned";
41 
42  HBox hBox;
43 
44  Alignment al(.5,.5,0.,0.);
45  al<<labs.grab(1); al.show();
46  hBox<<BoxIS(true,true,true)<<al<<buttons.grab(1);
47 
48  hBox.show();
49  topWindow<< hBox.getWidget();
50 
51  gtk_main();
52 }