我们创建 example4.c ,内容如下:
#include
static void print_hello(GtkWidget *button , gpointer data...(app);
gtk_window_set_title(GTK_WINDOW(window) , "grid test");
// gtk_window_set_default_size(...gtk_container_set_border_width(GTK_CONTAINER(window) , 20);
gtk_container_add(GTK_CONTAINER(window...(gtk_widget_destroy) , window);
gtk_grid_attach(GTK_GRID(grid) , button , 1 , 1 , 2 , 1);...gtk_grid_attach(GTK_GRID(grid) , button , 0 , 0 , 1 , 1);
该函数后面四个参数依次代表:第几行,第几列,横向跨度,纵向跨度。