Coatzacoalcos, Mexico to

PRINCIPAL

Home
Blog
Photo Gallery
Joke (Spanish: chistes)
Curriculum
Contacts me

GNU / LINUX

Linux.org
The gnu project
Slackware
Slackware forum
Debian
Debianitas punto net
Ubuntu Linux

ARTICLES

The Vi editor

Graphics with Turbo C++

The ftp manual

Installing the Apache Server

How to convert with Latex to PDF file

Configuring Samba.

A basic program in gtk+

OTHER ARTICLES

Introduction to Network security

How to Print Screen with yast.

The DNS Howto's

CONFERENCES

Free software in the Government
See material

Introduction to Linux.
See material

Database Security in MySQL.
See material

Stocastics Model for inundations.
See material




A basic program in gtk+.

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".


2005 - Farid A. Bielma Lopez

Home | Unix Mexico | El Demonio | OpenBSD | Ubuntu Guide
Internet.com | Barrapunto | Diario Linux | Unam - Cert | Securityfocus
Send me a mail.