- GL::push_matrix();
- GL::translate(geom.x, geom.y, 0);
- for(PartSeq::const_iterator i=style->get_parts().begin(); i!=style->get_parts().end(); ++i)
- render_part(*i);
- GL::pop_matrix();
+void Widget::set_focusable(bool f)
+{
+ input_type = (f ? INPUT_TEXT : INPUT_NONE);
+}
+
+void Widget::set_focus()
+{
+ if(!parent)
+ throw hierarchy_error("no parent");
+ if(!visible)
+ throw logic_error("!visible");
+
+ signal_request_focus.emit();
+}
+
+void Widget::set_enabled(bool e)
+{
+ set_state(DISABLED, (e ? NORMAL : DISABLED));
+}
+
+void Widget::set_state(State mask, State bits)
+{
+ State old_state = state;
+ state = (state&~mask)|bits;
+ if(style && style->compare_states(old_state, state))
+ mark_rebuild();
+}
+
+void Widget::set_animation_interval(const Time::TimeDelta &iv)
+{
+ if(iv<Time::zero)
+ throw invalid_argument("Widget::set_animation_interval");
+
+ anim_interval = iv;
+ signal_request_animation.emit(anim_interval);