in reply to Foo::Button->new vs. newButton()
Take a look at how Rui does it. You create a widget through its parent:
$label = $panel->Label(value => 'foo'); # is alias exi +sts $label = $panel->Rui__Widget__Label(value => 'bar'); # if not
It allows you to add aliases per project, solves the problem of the user having to set a parent on the child widget, allows you to change the real classes used for widgets in one place, and works with inheritance.
You want to look at Widget::Panel and Widget::Factory.
|
|---|