Citation :
#include <iostream>
#include <stdlib.h>
#include <gtk/gtk.h>
#define WELCOME "Welcome to TIM ! (v.0.1)"
using namespace std;
void OnDestroy(GtkWidget*, gpointer);
int main(int argc, char *argv[])
{
GtkWidget *pWindow, *pLabel;
gtk_init(&argc, &argv);
pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); pLabel = gtk_label_new(WELCOME);
gtk_window_set_title(GTK_WINDOW(pWindow), "Taron Instant Messenger - TIM" );
g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(OnDestroy), 0);
gtk_window_set_position(GTK_WINDOW(pWindow), GTK_WIN_POS_NONE);
gtk_window_set_default_size(GTK_WINDOW(pWindow), 285, 300);
gtk_container_add(GTK_CONTAINER(pWindow), pLabel);
gtk_widget_show_all(pWindow);
gtk_main();
return EXIT_SUCCESS;
}
void OnDestroy(GtkWidget *pWidget, gpointer pData)
{
gtk_main_quit();
}
|