
David Turner wrote:
window w("Test"); button b = w.spawn("button"); b.label("Click me"); w.contain(b);
Excuse me butting in, but this is redundant information: // b belongs to w button b = w.spawn("button"); // b belongs to w w.contain(b); It seems to me that you're trying to fit two concepts into one box, the widget and its properties. All this jumping through hoops occurs because you're trying to manipulate a "widget that must belong to a window" when in actual fact you're interested only in its properties: button_properties bp; bp.label("Click me"); bp.size(10,10); bp.foreground_color(red); window w; w.add_widget(bp); Persumably, therefore, the button_widget's constructor would be struct button_widget { button_widget(window const &, button_properties const &); }; Regards, Angus