#include <gtk/gtk.h> #include "vipLogin.h" void answer_user( GtkWidget *widget,gpointer data ) { gtk_widget_hide(data); } void answer_VIP( GtkWidget *widget,gpointer data ) { gtk_widget_hide(data); vipLogin( ); } int answer( ) { GtkWidget *window1; GtkWidget *button2; GtkWidget *button3; GtkWidget *label6; GtkWidget *label7; GtkWidget *table; window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window1), "VIP登陆"); gtk_window_set_default_size(GTK_WINDOW(window1), 500, 500); gtk_window_set_position(GTK_WINDOW(window1),GTK_WIN_POS_CENTER_ALWAYS ); gtk_container_set_border_width (GTK_CONTAINER (window1), 30); table = gtk_table_new (9, 9, TRUE); gtk_container_add (GTK_CONTAINER (window1), table); button2 = gtk_button_new_with_label ("普通用户叫号"); button3 = gtk_button_new_with_label ("VIP用户登陆叫号"); label6 = gtk_label_new ("预计等待时间"); label7 = gtk_label_new ("预计等待时间,已为您节省**"); gtk_table_attach_defaults (GTK_TABLE (table), button2, 0, 4, 2, 6); gtk_table_attach_defaults (GTK_TABLE (table), button3, 5, 9, 2, 6); gtk_table_attach_defaults (GTK_TABLE (table), label6, 0, 4, 6, 7); gtk_table_attach_defaults (GTK_TABLE (table), label7, 5, 9, 6, 7); g_signal_connect (G_OBJECT (button2), "clicked",G_CALLBACK (answer_user), (gpointer) window1); g_signal_connect (G_OBJECT (button3), "clicked",G_CALLBACK (answer_VIP), (gpointer) window1); gtk_widget_show_all(window1); gtk_main (); return 0; }