in reply to Prima: How to get a "table" layout?

Would you like to show us some short example code that we can run and play with? I'm sure I could whip something up, but I'm too lazy.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
  • Comment on Re: Prima: How to get a "table" layout?

Replies are listed 'Best First'.
Re^2: Prima: How to get a "table" layout?
by haj (Vicar) on Jan 17, 2025 at 12:45 UTC
    Sure:
    use 5.032; use Prima qw(Application Label InputLine); my $main = Prima::MainWindow->create( text => 'Configuration', backColor => cl::White, menuItems => [ ['~File' => [['~Quit' => 'Ctrl+Q', '^Q', sub { $::application->close } ], ], ], ] ); my $fps = $main->insert( Widget => pack => { side => 'top' }, ); $fps->insert( Label => text => 'Refresh rate: ', pack => { side => 'left' }, ); $fps->insert( InputLine => text => '60', pack => { side => 'left' }, ); $fps->insert( Label => text => 'FPS', pack => { side => 'left' }, ); my $res = $main->insert( Widget => pack => { side => 'top' }, ); $res->insert( Label => text => "Spectral resolution", pack => { side => 'left' }, ); $res->insert( InputLine => text => '10', pack => { side => 'left' }, ); $res->insert( Label => text => 'Hz', pack => { side => 'left' }, ); my $limit = $main->insert( Widget => pack => { side => 'top' }, ); $limit->insert( Label => text => "Show spectrum up to", pack => { side => 'left' }, ); $limit->insert( InputLine => text => '5000', pack => { side => 'left' }, ); $limit->insert( Label => text => 'Hz', pack => { side => 'left' }, ); Prima->run;

      I had a quick look over the weekend, but couldn't get Prima to install against Strawberry Perl. Not mission critical for me, so I didn't chase it down.

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

        Fair enough. For what it is worth: I am running Prima on Strawberry Perl (the 5.38 PDL edition) but don't recall its history. Sometimes Prima tests act up, (in particular those running tests on character display. Perhaps I skipped tests.

        A reply falls below the community's threshold of quality. You may see it by logging in.