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
ComboBoxTextTest.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 #include "gtkInterface.H"
18 #include "Buttons.H"
19 #include "ComboBoxText.H"
20 
21 static void quit(void *wid, gpointer data) {
22  gtk_main_quit();
23 }
24 
25 int main(int argc, char *argv[]) {
26 
27  gtk_init( &argc, &argv );
28 
29  GtkInterface topWindow;
30  Buttons buttons;
31  HBox hBox;
32 
33  buttons<<BUTTONLABELSTRUCT("Quit", quit, &buttons); // Quit button
34 
35  ComboBoxText combo;
36  combo<<"entry 1"<<"entry 2";
37  combo<<string("entry 3");
38  combo.show();
39  hBox<<BoxIS(true, true, true)<<combo;
40 
41  combo.setSelection(1); // equivalent to combo.setSelection("entry 2");
42  combo.setSelection("entry 2"); // equivalent to combo.setSelection(1);
43 
44  hBox<<buttons; // Same as hBox<< buttons.grab(1)<< buttons.grab(2)<< buttons.grab(3)<< buttons.grab(4);
45  hBox.show();
46  topWindow<< hBox;
47 
48  gtk_main();
49 }
50 
51 /* IF you need to test against GTK+ 2.20, or other version. Install the sources. cd gtk+-2.20.1
52 ./configure
53 make
54 
55 Then go into the test directory and change testcombo* to your file name.
56 
57  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../gdk -I../gdk -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0 -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_DEPRECATED -g -O2 -Wall -MT testcombo.o -MD -MP -MF .deps/testcombo.Tpo -c -o testcombo.o testcombo.c
58 
59 g++ -DGDK_PIXBUF_DISABLE_DEPRECATED -g -O2 -Wall -o .libs/testcombo testcombo.o -pthread ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so ../gdk/.libs/libgdk-x11-2.0.so ../gtk/.libs/libgtk-x11-2.0.so /home/flatmax/temp/gtk+-2.20.1/gdk/.libs/libgdk-x11-2.0.so -lXext -lXrender -lXinerama -lXrandr -lXcursor /home/flatmax/temp/gtk+-2.20.1/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so -lgmodule-2.0 -lrt -lpangocairo-1.0 -lX11 -lXcomposite -lXdamage -lXfixes -latk-1.0 /usr/lib/x86_64-linux-gnu/libcairo.so -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 /usr/lib/x86_64-linux-gnu/libfreetype.so -lfontconfig -lgobject-2.0 -lglib-2.0 -lm -pthread
60 */