- Prison Code Breaker Diary -

=> aka: Nhật Kí Code Tù

Categories

Gtk+ aka. GIMP Tools Kit is a framework what support GUI for Linux application (mainly). It's used under Gnome Environment in most of Linux distributions.
If you have interests in programming Gtk+ to create GUI application under Gnome or any others, why not try a simple Gtk+ app with me first?

The following code is self-explained and easy-to-understand. peace


/*
* @author [JaPh]
* @date July 13, 2009
* @source GtkApp_01.c
* @site http://xjaphx.blogspot.com/
*/

/* HEADERS */
#include <gtk/gtk.h>

/* MAIN */
int
main( int argc, char *argv[] )
{
/* declare new Gtk Widget */
GtkWidget *window;

/* initiate gtk app */
gtk_init( &argc, &argv );

/* create new Gtk Top-Level Window */
window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
/* set window title */
gtk_window_set_title( GTK_WINDOW( window ), "Begin GTK+ w/ [JaPh]");
/* set window border */
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
/* set window size */
gtk_widget_set_size_request( window, 400, 300 );

/* connect signals on destroy app */
g_signal_connect( GTK_WINDOW( window ), "destroy", G_CALLBACK( gtk_main_quit ), NULL );

/* show Gtk window */
gtk_widget_show_all( window );

/* Gtk main app activate */
gtk_main( );

/* app return */
return 0;
}

Well, try to modify to see some effects. senyumkenyit

Have fun!@

0 comments

Post a Comment