単純なレイアウトで基本的なアプリケーションを作成しましたが、全体を塗りつぶすGtkGrid
ことができません。これは、レイアウトを作成するためのコードです。GtkGrid
GtkWindow
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), 800, 600);
GtkWidget *grid = gtk_grid_new();
g_signal_connect(window,"destroy", G_CALLBACK(gtk_main_quit), NULL);
GtkWidget *vpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
gtk_paned_set_position (GTK_PANED (vpaned), 400);
GtkWidget *label = gtk_label_new("Label1111111111111111111111111111111");
GtkWidget *label2 = gtk_label_new("Label2");
GtkWidget *label3 = gtk_label_new("Label3");
GtkWidget *label4 = gtk_label_new("Label4");
gtk_paned_pack1 (GTK_PANED (vpaned), label, FALSE, TRUE);
gtk_paned_pack2 (GTK_PANED (vpaned), label2, FALSE, TRUE);
gtk_widget_show (label);
gtk_widget_show (label2);
gtk_widget_show (label3);
gtk_widget_show (label4);
gtk_widget_show (vpaned);
gtk_grid_attach(GTK_GRID(grid), label3, 0,0,1,1);
gtk_grid_attach(GTK_GRID(grid), vpaned, 0,1,1,1);
gtk_grid_attach(GTK_GRID(grid), label4, 0,2,1,1);
gtk_widget_show(grid);
gtk_container_add(GTK_CONTAINER(window), grid);
gtk_widget_show (window);