Getting start
- From: "hs_gtk" <hs_gtk etang com>
- To: gtk-list gnome org
- Subject: Getting start
- Date: Tue, 11 Jul 2000 13:44:28 +0800 (CST)
Hello,
I compiled this c file,It is from "GTK+/Gnome Application Development".
$ gcc 001.c
and i got the follow report:
In file included from /usr/include/gdk/gdktypes.h:33
In file included from /usr/include/gdk/gdk.h:31
In file included from /usr/include/gdk/gtk.h:31
from 001.c:1:
/usr/include/glib.h:66: glibconfig.h: No such file or directory.
Can anyone help me?
-----------------------------------------
Econnect ÈùµÍ¨¸ü¼òµ¥ http://connect.etang.com
#include <gtk/gtk.h>
static gint delete_event_cb(GtkWidget* w, GdkEventAny* e, gpointer data);
static void button_click_cb(GtkWidget* w, gpointer data);
int main(int argc, char* argv[])
{
GtkWidget* window;
GtkWidget* button;
GtkWidget* label;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
button = gtk_button_new();
label = gtk_label_new("Hello, World!");
gtk_container_add(GTK_CONTAINER(button), label);
gtk_container_add(GTK_CONTAINER(window), button);
gtk_window_set_title(GTK_WINDOW(window), "Hello");
gtk_container_set_border_width(GTK_CONTAINER(button), 10);
gtk_signal_connect(GTK_OBJECT(window),
"delete_event",
GTK_SIGNAL_FUNC(delete_event_cb),
NULL);
gtk_signal_connect(GTK_OBJECT(button),
"clicked",
GTK_SIGNAL_FUNC(button_click_cb),
label);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
static gint delete_event_cb(GtkWidget* window, GdkEventAny* e, gpointer data)
{
gtk_main_quit();
return FALSE;
}
static void button_click_cb(GtkWidget* w, gpointer data)
{
GtkWidget* label;
gchar* text;
gchar* tmp;
label = GTK_WIDGET(data);
gtk_label_get(GTK_LABEL(label), &text);
tmp = g_strdup(text);
g_strreverse(tmp);
gtk_label_set_text(GTK_LABEL(label), tmp);
g_free(tmp);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]