minor change in example runner
This commit is contained in:
parent
fbd680d11f
commit
1aab4948e9
|
@ -10,6 +10,6 @@ int main()
|
|||
w->alignment = Caption::Alignment::CENTER;
|
||||
w->text("¡jello!");
|
||||
w->font(f);
|
||||
});
|
||||
}, 4, 8);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue