-void Widget::update_style()
-{
- Widget *top;
- for(top=this; top->parent; top=top->parent) ;
- Root *root = dynamic_cast<Root *>(top);
- if(!root)
- style = 0;
- else
- {
- string sname = get_class();
- if(!style_name.empty())
- {
- sname += '-';
- sname += style_name;
- }
-
- style = root->get_resources().get<Style>(sname);
- }
-
- on_style_change();
-}
-
-void Widget::update_style(Widget &w)
-{
- w.update_style();
-}
-
-void Widget::set_parent(Container *p)
-{
- if(parent && p)
- throw InvalidState("Widget is already in a Container");
- parent = p;
-
- on_reparent();
- update_style();
-}
-
-void Widget::set_parent(Widget &w, Container *p)
-{
- w.set_parent(p);
-}
-