What is GTK? <ul><li>“ GTK+ is a highly usable, feature rich toolkit for creating graphical user interfaces which boasts cross platform compatibility and an easy to use API. GTK+ it is written in C, but has bindings to many other popular programming languages” http://www.gtk.org
Glib <ul><li>GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on. It works on many UNIX-like platforms, Windows, OS/2 and BeOS. GLib is released under the GNU Library General Public License (GNU LGPL). </li></ul>
GObject <ul><li>A generic type system to register arbitrary single-inherited flat and deep derived types as well as interfaces for structured types. It takes care of creation, initialization and memory management of the assorted object and class structures, maintains parent/child relationships and deals with dynamic implementations of such types. That is, their type specific implementations are relocatable/unloadable during runtime.
A collection of fundamental type implementations, such as integers, doubles, enums and structured types, to name a few.
A sample fundamental type implementation to base object hierarchies upon - the GObject fundamental type. </li></ul>
Gobject (Cont'd) <ul><li>A signal system that allows very flexible user customization of virtual/overridable object methods and can serve as a powerful notification mechanism.
An extensible parameter/value system, supporting all the provided fundamental types that can be used to generically handle object properties or otherwise parameterized types. </li></ul>
Initialization and the main event loop <ul><li>gtk_init() </li><ul><li>initializes the GTK environment
Should be called at the beginning of the program
Terminates the program if it failed to initialize the environment </li></ul><li>get_main() </li><ul><li>Starts the event loop that will check for the signals connected to the widgets </li></ul></ul>
Data Types (widgets hierarchy) <ul><li>http://www.gtk.org/tutorial1.2/gtk_tut-5.html </li></ul>
Call back functions <ul><li>Signals </li><ul><li>Widgets need to be notified if the user clicked, typed, etc.
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL); </li></ul><li>Call back functions </li><ul><li>Simply “Functions that signal handlers call in case that signal occurred” </li></ul></ul>