码迷,mamicode.com
首页 > 其他好文 > 详细

call.c

时间:2015-01-20 15:28:06      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

#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

标签:

原文地址:http://www.cnblogs.com/chaosi/p/4235872.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!