首页 > 代码库 > call.c
call.c
#include <gtk/gtk.h>#include <answer.h> void do_button1(GtkWidget *widget,gpointer data ){ } void do_button2(GtkWidget *widget,gpointer data ){ answer();} void call(){ GtkWidget *window; GtkWidget *button1; GtkWidget *button2; GtkWidget *label; GtkWidget *fixed = gtk_fixed_new(); window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window),"call system"); gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER_ALWAYS ); //窗体居中 gtk_window_set_default_size(GTK_WINDOW(window),420,490); button1= gtk_button_new_with_label("Statement"); gtk_widget_set_size_request(button1,250,50); button2= gtk_button_new_with_label("call"); gtk_widget_set_size_request(button2,250,300); g_signal_connect (G_OBJECT(button1),"clicked",G_CALLBACK(do_button1),(gpointer)window); g_signal_connect (G_OBJECT(button2),"clicked",G_CALLBACK(do_button2),(gpointer)window); label=gtk_label_new(" call system"); gtk_widget_set_size_request(label,250,50); gtk_fixed_put(GTK_FIXED(fixed),button1,85, 25); gtk_fixed_put(GTK_FIXED(fixed),button2,85, 100); gtk_fixed_put(GTK_FIXED(fixed),label,85,415); gtk_container_add(GTK_CONTAINER(window),fixed); gtk_widget_show_all(window); gtk_main ();}
call.c
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。