Now we create a MainWindow containing two widgets: the familiar Pusbutton and the new Label. The basic
Clicking the Pushbutton generates a random number, that is displayed in the Label field.
It's no problem to use theuse Prima qw(Application Buttons Label); # invoke the modules Application, Buttons and Label $mw = Prima::MainWindow-> create( text => "Random", sizeMin => [250, 200],# fixed minimal size sizeMax => [250, 200],# fixed maximal size skin => 'flat', ); $mw-> borderIcons(bi::SystemMenu);# system menu button and/or close button ( usually with icon ) is shown $output = $mw-> insert( Label => origin => [110, 125], size => [50, 50], text => "", font => { size => 26, }, ); $mw-> insert( Button => origin => [50, 75], size => [150, 50], text => "Random number!", default => 1, onClick => sub { $random_number = int(rand(100)); $output-> set(text => $random_number); }, ); run Prima;