minor change in example runner

This commit is contained in:
Andrea Blankenstijn 2021-07-20 15:09:25 +02:00
parent fbd680d11f
commit 1aab4948e9
2 changed files with 4 additions and 4 deletions

View file

@ -10,6 +10,6 @@ int main()
w->alignment = Caption::Alignment::CENTER;
w->text("¡jello!");
w->font(f);
});
}, 4, 8);
return 0;
}

View file

@ -20,7 +20,7 @@ template<typename T>
concept Widget = std::derived_from<T, widget::Widget>;
template<Widget W>
void run_example(std::function<void (W*, core::Font*, int, int)> setup)
void run_example(std::function<void (W*, core::Font*, int, int)> setup, int w=3, int h=3)
{
try
{
@ -39,10 +39,10 @@ void run_example(std::function<void (W*, core::Font*, int, int)> setup)
auto* layout {new widget::HorizontalLayout()};
for (auto y = 0; y < 3; y++)
for (auto x = 0; x < w; x++)
{
auto* col = new widget::VerticalLayout();
for (auto x = 0; x < 3; x++)
for (auto y = 0; y < h; y++)
{
auto* widget = new W();
setup(widget, font, x, y);