overview gui programming with gtk+ and glade 장정철

15
Overview GUI Programming with GTK+ and GLADE 장장장

Upload: cecily-watts

Post on 18-Jan-2016

236 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: Overview GUI Programming with GTK+ and GLADE 장정철

Overview

GUI Programming with GTK+ and GLADE 장정철

Page 2: 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

Page 3: Overview GUI Programming with GTK+ and GLADE 장정철

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

Page 4: Overview GUI Programming with GTK+ and GLADE 장정철

Environment - linux

Page 5: Overview GUI Programming with GTK+ and GLADE 장정철

Environment - linux

Page 6: Overview GUI Programming with GTK+ and GLADE 장정철

Sample – Linux

Page 7: Overview GUI Programming with GTK+ and GLADE 장정철

Environment – Win32

Page 8: Overview GUI Programming with GTK+ and GLADE 장정철

Environment – Win32

Page 9: Overview GUI Programming with GTK+ and GLADE 장정철

Sample – Win32

Page 10: Overview GUI Programming with GTK+ and GLADE 장정철

UI Design - GLADE

Page 11: Overview GUI Programming with GTK+ and GLADE 장정철

UI Design - GLADE

Page 12: Overview GUI Programming with GTK+ and GLADE 장정철

UI Dynamic Loading - libglade

• Simple usage1. Include header file libglade.h2. UI XML file open with function glade_xml_new3. get widget from XML with function glade_xml_get_widget4. Connect signal of loaded widget5. 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`

Page 13: Overview GUI Programming with GTK+ and GLADE 장정철

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)

Page 14: Overview GUI Programming with GTK+ and GLADE 장정철

Sample - gengdic

Page 15: Overview GUI Programming with GTK+ and GLADE 장정철

Sample – t-gtk with xHarbour