Separated the widget allocating from the widget setting, fixing most of the widget-resize bugs in the process. (Though they did create some interesting effects -- for example, when the window was resized, all previous widgets were kept in place, and the new ones were still added.)
This basically involved putting calls to add_allocate_widget() in an initialization function like init_game(), and calling set_* (e.g., set_button()) in the resize_*_images() functions instead of add_widget(..., allocate_*(), ...).
allocate_*() (e.g., allocate_button()) were changed to set_*() (e.g., set_button()).
set_widget() and sizeof_widget_structure() were added.
The new function add_allocate_widget() is the same as add_widget(panel, allocate_widget(id, type)).