[glugot] GLUGOT session #11 minutes

  • From: "Arun Ponniah S" <sap@xxxxxxx>
  • To: glugot@xxxxxxxxxxxxx
  • Date: Wed, 12 Jan 2005 12:45:44 +0530 (IST)

Hello all,
  I have attached the minutes of the meet.

-- sap --

Blog : http://saponniah.blogspot.com/

This email was sent using TCEMail Service.
Thiagarajar College of Engineering
Madurai - 625015 (India)

GTK (GIMP Toolkit) is a library for creating graphical user interface.GTK is 
used for developing GNU Image Manipulation Program (GIMP) and GNU Network 
Object Model Environment project.GTK is an object oriented application 
progammers interface(API).

Components of GTK:
1.GDK (GIMP Drawing Kit)
2.gdk-pixbuf, a library for client side image manipulation
3.Glib -  Contains Replacement functions to increase GTK's portability and 
additional functions to handle linklists etc..
4.Pango library for internationalized text output

There are GTK bindings for many other languages including  
C++,Guile,Python,Ada95,TOM,Free Pascal,C#.


Any object to be placed in the user interface is called as a Widget in GTK. For 
example window,buttons,label,image,menulist,tool.Widgets are created using the 
function like 
          Ex. gtk_window_new().

Various attributes are associated with different widgets.they can also be set.

Signals and Callbacks:

GTK is an event driven toolkit,which means it will sleep in gtk_main() function 
until an event occurs and the control is passed to the approriate function.This 
passing of controls is done using the idea of  â??Signalsâ??.When an event 
occurs such as press of a mouse button,approriate signal will be emitted by the 
widget that was pressed.This is how does most of its useful work.

To make any widget perform some action,we set up a signal handler to catch the 
signals  and call the appropriate function.

Signals are connected to the widgets using the function:
        g_signal_connect(instance,detailed signal,c_handler,data)
instance : the widget toconnect to
detailed signal: the signal
c_handler: the callback function name
data: data to pass to c_handler calls

returns handler id.

The callback function is of the form 
        void callback_func(GtkWidget *widget,gpointer callback_dat)

Packing of Widgets:
When an application is created, it may be reqiured to put many widgets into the 
window.The positioning of the widgets is done by packing.Packing can be done in 
two ways namely,
1. Creating boxes
2.Using tables.

Creating boxes:
Boxes are invisible widget containers that we can pack widgets in one of two 
forms, a horizontal box and a vertical box.When packing into a horizontal 
box,the objects are inserted horizontally from left to right or right to left 
depending on the call used.In vertical box,widgets are packed from top to 
bottom  or viceversa.
Boxes are created using functions:
Widgets are packed using functions:

Using Tables:
Using tables,we can create a grid thatwe can place widgets in.The widgets may 
take up as many spaces as one specifies.

 Tables are created using
   Widgets are placed into the grid using
After packing widgets are displayed using 

Example progam:
main(int argc,char *argv[])
  GtkWidget *window;
  window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_show (window);
  return 0;

The program is compiled as follows
gcc t1.c -o t1 `pkg-config â??cflags â??libs gtk+-2.0`

Other related posts:

  • » [glugot] GLUGOT session #11 minutes