- const float font_size=font->get_default_size();
- unsigned text_w=static_cast<unsigned>(font->get_string_width(text)*font_size);
+void Widget::set_focus()
+{
+ if(!parent)
+ throw InvalidState("No parent");
+ if(!visible)
+ throw InvalidState("Can't set focus on invisible widget");
+
+ signal_request_focus.emit();
+}
+
+void Widget::render() const
+{
+ if(!style)
+ throw InvalidState(format("Attempt to render a widget with null style (class=\"%s\", style_name=\"%s\")", get_class(), style_name));