|
GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites.
GTK+ is free software and part of the GNU Project. However, the licensing terms for GTK+, the GNU LGPL, allow it to be used by all developers, including those developing proprietary software, without any license fees or royalties.
The program draw a window with any widgets, the program uses signal that is the base in the gtk+ library.
Example:
#include "libintl.h"
#include "gtk/gtk.h"
gint close1 (GtkWidget *widget, gpointer gdata) {
g_print ("Quit.........\n");
gtk_main_quit();
return (FALSE);
}
int main(int argc, char *argv[])
{
GtkWidget *window,*label1;
gtk_init(&argc,&argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "My first aplication in gtk+");
gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (close1), NULL);
gtk_container_border_width (GTK_CONTAINER (window), 40);
label1 = gtk_label_new ("Hola mundo gtk+");
gtk_container_add (GTK_CONTAINER (window),label1 );
gtk_widget_show (window);
gtk_widget_show (label1);
gtk_main();
return 0;
}
Coments: Note that the widgets are the most important and they are visibles in the aplication with the sentence "gtk_widget_show".
|