GtkWidget* window;
GtkWidget* button;
GtkWidget* container;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
container = gtk_table_new(2, 2, FALSE);
gtk_container_add(GTK_CONTAINER(window), container);
gtk_window_set_title(GTK_WINDOW(window), "Table Attaching");
gtk_container_set_border_width(GTK_CONTAINER(container), 10);
/* This would be a bad idea in real code; but it lets us
* experiment with window resizing.
*/
gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
gtk_signal_connect(GTK_OBJECT(window),
"delete_event",
GTK_SIGNAL_FUNC(delete_event_cb),
NULL);
button = gtk_button_new_with_label("1. Doesn't shrink\nor expand");
gtk_table_attach(GTK_TABLE(container),
button,
0, 1,
0, 1,
GTK_FILL,
GTK_FILL,
0,
0);
button = gtk_button_new_with_label("2. Expands and shrinks\nvertically");
gtk_table_attach(GTK_TABLE(container),
button,
0, 1,
1, 2,
GTK_FILL,
GTK_FILL | GTK_EXPAND | GTK_SHRINK,
0,
0);
button = gtk_button_new_with_label("3. Expands and shrinks\nin both directions");
gtk_table_attach(GTK_TABLE(container),
button,
1, 2,
0, 2,
GTK_FILL | GTK_EXPAND | GTK_SHRINK,
GTK_FILL | GTK_EXPAND | GTK_SHRINK,
0,
0);
|