$ ls fsf.glade stallman.jpg $ |
$ gtk-builder-convert fsf.glade fsf.ui Wrote fsf.ui $ ls fsf.glade fsf.ui stallman.jpg $ cat fsf.ui <?xml version="1.0"?> <!--Generated with glade3 3.4.5 on Sun Nov 29 12:39:11 2009 --> <interface> <object class="GtkWindow" id="window1"> <child> <object class="GtkVBox" id="vbox1"> <property name="visible">True</property> <child> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="pixbuf">stallman.jpg</property> </object> </child> <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="label" translatable="yes">Richard Stallman</property> </object> <packing> <property name="position">1</property> </packing> </child> </object> </child> </object> </interface> $ |
$ ls fsf.c fsf.glade fsf.ui Makefile stallman.jpg $ cat Makefile all: gcc `pkg-config --cflags --libs gtk+-2.0` fsf.c clean: rm -f *~ a.out $ cat fsf.c #include <gtk/gtk.h> static void window_close(GtkWidget *widget,gpointer data) { gtk_main_quit(); } int main(int argc,char *argv[]) { GtkBuilder *builder; GError *error; GtkWidget *window; gtk_init(&argc,&argv); builder=gtk_builder_new(); gtk_builder_add_from_file(builder,"fsf.ui",&error); window=GTK_WIDGET(gtk_builder_get_object(builder,"window1")); g_object_unref(G_OBJECT(builder)); g_signal_connect(window,"destroy",G_CALLBACK(window_close),NULL); gtk_widget_show_all(window); gtk_main(); return 0; } $ |
$ make gcc `pkg-config --cflags --libs gtk+-2.0` fsf.c $ ./a.out |
$ ls /usr/lib/pkgconfig/gtk+-2.0.pc /usr/lib/pkgconfig/gtk+-2.0.pc $ cat /usr/lib/pkgconfig/gtk+-2.0.pc prefix=/usr exec_prefix=${prefix} libdir=/usr/lib includedir=${prefix}/include target=x11 gtk_binary_version=2.10.0 gtk_host=i486-pc-linux-gnu Name: GTK+ Description: GIMP Tool Kit (${target} target) Version: 2.12.12 Requires: gdk-${target}-2.0 atk cairo Libs: -L${libdir} -lgtk-${target}-2.0 Cflags: -I${includedir}/gtk-2.0 $ |
$ ls /usr/lib/pkgconfig/gstreamer-0.10.pc /usr/lib/pkgconfig/gstreamer-0.10.pc $ |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |