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
LabelsTest2.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 "Buttons.H"
22 #include "Labels.H"
23 
24 static void quit(void *wid, gpointer data){
25  gtk_main_quit();
26 }
27 
28 int main(int argc, char *argv[]){
29 
30  gtk_init( &argc, &argv ); // init GTK
31 
32  GtkInterface topWindow; // Create the top box
33 
34  Buttons buttons; // create a quit button
35  Labels labs; // create a labels list
36  HBox hBox; // create an HBox
37  VBox vBox; // create a VBox
38 
39  // create a quit buttons and add two labels to a VBox
40  // At the same time, add them to the HBox
41  hBox << (vBox << (labs<<" this is 2"<<" this is 1")) // create and add the labels to the VBox to the HBox
42  << (buttons<<BUTTONLABELSTRUCT("Quit", quit, NULL)); // create and add the button to the HBox
43 
44  vBox.show(); // show the VBox
45  hBox.show(); // show the HBox
46  topWindow << hBox; // Load the HBox into the top window
47 
48  gtk_main(); // run GTK+
49 }