Pages

Monday, January 31, 2011

My first Gtk based C program

Information: GTk+ is a C Library used to build graphical user interfaces (GUIs). Although Gtk is written in C, but can be binded with other languages like C++, Python and C#.
To learn Gtk, I found gnome document library to be a great place.The tutorial are explained in detail and provide a great platform for the beginners to start using Gtk.

Code:

#include<gtk/gtk.h>

int main(int argc,char *argv[])

{

    GtkWidget *window;

    gtk_init(&argc,&argv);

    window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_show(window);

    gtk_main();

    return 0;
}


Screenshot:





Source: http://library.gnome.org/devel/gtk-tutorial/2.90/c39.html

No comments:

Post a Comment