150 likes | 273 Views
Overview. GUI Programming with GTK+ and GLADE. 장정철. Overview – GTK+. The GIMP ToolKit the GNU LGPL 2.1 Base of GTK+ GLIB low-level core library – basis of GTK+ data structure, portability, event loop, thread, dynamic loading, object Pango Layout and rendering of text
E N D
Overview GUI Programming with GTK+ and GLADE 장정철
Overview – GTK+ • The GIMP ToolKit • the GNU LGPL 2.1 • Base of GTK+ • GLIB • low-level core library – basis of GTK+ • data structure, portability, event loop, thread, dynamic loading, object • Pango • Layout and rendering of text • text and font handling • Cairo • 2D graphics with support for multiple output devices • ATK • Set of interface providing accessibility
Overview - GLADE • User Interface Designer for GTK+ and GNOME • the GNU GPL • saved as XML • Generating C sources • using libglade, loaded by applications dynamically • Glade-3 is a complete rewrite • Useful new features • Undo / Redo • Multiple project supportand
UI Dynamic Loading - libglade • Simple usage • Include header file libglade.h • UI XML file open with function glade_xml_new • get widget from XML with function glade_xml_get_widget • Connect signal of loaded widget • Linking with libglade #include <glade/glade.h> #include <glade/glade-xml.h> sp_main_xml = glade_xml_new( UI_XML_FILE, NULL, NULL ); sp_window = glade_xml_get_widget( sp_main_xml, "window_bm104" ); g_signal_connect( G_OBJECT( sp_window ), "delete_event", G_CALLBACK( on_window_exit ), NULL ); # gcc –o bm104 bm104.c ucs-utils.c ucs-cell-renderer.c `pkg-config –cflags –libs gtk+-2.0 libglade-2.0`
Languages • not only support C • gtkmm for C++ • java-gnome for JAVA • PyGTK for Python • gtk2-perl for Perl • RGtk2 for R • lua-gtk for Lua • gtkd for D • tGtk for Harbour(xHarbour)