You don't have to worry about only having numbers. After all some people might like to enter month names as text, not to mention slashes and other things that are often used in locale dependent ways. Just parse it, see if it is valid, and if not revert. The following is an example (haven't tested it so it likely won't run but hopefully will help start things moving):
Code:
gchar s[20];
...
void entry_cb(GtkEntry* entry, gpointer data)
{
gchar* str;
GDate* date;
str=gtk_entry_get_text(entry);
date=g_date_new();
g_date_set_parse(date, str);
if (g_date_valid(date)) g_snprintf(s, 20, "%s", str);
else gtk_entry_set_text(entry, s);
g_date_free(date);
g_free(str);
}
...
int main...
{
GDate* date;
GtkWidget* entry;
...
entry=gtk_entry_new();
date=g_date_new();
g_date_set_time_t (date, time (NULL));
if (g_date_strftime(s, 20, "%x", date)) gtk_entry_set_text(GTK_ENTRY(entry), s);
g_date_free(date);
g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(entry_cb), NULL);
...
}
Regarding sizing, you need to consider both horizontal and vertical dimensions. With the buttons stacked vertically you may want them to be flush with the top and bottom of the entry field in which case everything will need to be able to expand and fill vertically at least (the vbuttonbox may take care of this for you anyway). You probably are better putting it into a table which allows for more consistency of alignment (and future proofing as gtk3 is moving away from boxes) and letting the entry span two rows. If the containing boxes are expanding you may need to set up GtkAlignment containers to force the entry and buttons to be pushed up against each other.