Now "closewindow" attribute works for <button> widget when it isn't inside a window.

This commit is contained in:
David Capello 2011-04-21 17:17:16 -03:00
parent 9e252f992f
commit 5bbf0140cd

View File

@ -151,11 +151,9 @@ static Widget* convert_xmlelement_to_widget(TiXmlElement* elem, Widget* root)
setup_bevels(widget, b[0], b[1], b[2], b[3]);
}
if (closewindow && root) {
if (Frame* frame = dynamic_cast<Frame*>(root)) {
static_cast<Button*>(widget)->
Click.connect(Bind<void>(&Frame::closeWindow, frame, widget));
}
if (closewindow) {
static_cast<Button*>(widget)
->Click.connect(Bind<void>(&Widget::closeWindow, widget));
}
}
}