I'm attempting to build a really simple browser using gtk+ and webkitgtk. This necessitates what a typical browser would need: a uri bar, a back button, home button, and actual webpage display area. The problem is that GTKWindow can only have at most one child widget. After looking at the documentation, it recommended packing, particularly using grids. I created the grid layout, but when running the code, I get just the text box in the top left corner (what'll be the URL bar) with no webkitwebview. If I set the row and column #s to be the same as the textbox, however, and hover over it, will display a really pinched version of the webkitwebview. How do I go about making the webkitwebview display fully, while at the same time, have multiple widgets in the window?
gtk_init(&argc, &argv);
// Create an 800x600 window that will contain the browser instance
GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(main_window), 800, 600);
// create the gtk grid that'll set the layout and put grid in window
GtkWidget *grid = gtk_grid_new();
gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(grid));
// create url_bar and add to grid
GtkWidget *url_bar = gtk_entry_new();
gtk_grid_attach(GTK_GRID (grid), url_bar, 0, 0, 1, 1);
// Create a browser instance and put in main window
WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
gtk_grid_attach(GTK_GRID (grid), GTK_WIDGET (webView), 1, 1, 4, 4);
// Set up callbacks so that if either the main window or the browser instance is
// closed, the program will exit
g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindowCb), NULL);
g_signal_connect(webView, "close", G_CALLBACK(closeWebViewCb), main_window);
// Load a web page into the browser instance
webkit_web_view_load_uri(webView, "http://webkitgtk.org");
// Make sure that when the browser area becomes visible, it will get mouse
// and keyboard events
gtk_widget_grab_focus(GTK_WIDGET(webView));
// Make sure the main window and all its contents are visible
gtk_widget_show_all(main_window);
// Run the main GTK+ event loop
gtk_main();enter code here