use Prima qw( StdBitmap ); use Prima::Application name => __FILE__, icon => Prima::StdBitmap::icon( sbmp::Logo ); use Prima::StartupWindow; #use Prima qw( Buttons Widget Edit FrameSet TextView Lists InputLine ); use Prima qw( Buttons Edit FrameSet TextView Lists InputLine ); BEGIN { sleep 1; } # in case its loads quickly ;) no Prima::StartupWindow; my $w = Prima::Window-> create( onDestroy => sub {$::application->close}, text => "Perl Monks Prima Chatter", # size => [ map { $_ - 128} $::application->size], size => [ 300, 300 ], ); my $frame = $w->insert( FrameSet => size => [$w->size], origin => [0, 0], frameSizes => [qw(30 *)],# bottom top opaqueResize => 1, arrangement => fra::Vertical, # frameProfiles => [ 0,0, { minFrameWidth => 123, maxFrameWidth => 123 }], growMode => gm::Client, ); #use Data::Dumper; die Dumper $w; my $one = $frame->frames->[0]; $$one{'maxFrameWidth'} = 30; $$one{'minFrameWidth'} = 30; $one->growMode(gm::GrowHiX); $one->insert( InputLine => alignment => ta::Left, origin => [0,0], autoSelect => 1, size => [260,30], # size => [$frame->frames->[1]->size], width => ($one->size)[0] - 60, text => 'asdf', maxLen => 260, growMode => gm::GrowHiX, ); $one->insert( Button => origin => [ ($one->size)[0] - 60, 0], text => "talk", size => [ 60, 30 ], default => 1, hint => 'Hit this button to talk if you are logged in', growMode => gm::Right, ); my $subframe = $frame->insert_to_frame( 1, FrameSet => arrangement => fra::Horizontal, size => [$frame->frames->[1]->size], origin => [0, 0], opaqueResize => 1, name => 'SubFrame', frameSizes => [qw( * 100 )], # frameProfiles => [ 0,0, { minFrameWidth => 123, maxFrameWidth => 123 }], growMode => gm::Client, ); $subframe->frames->[0]->minFrameWidth(100); $subframe->growMode(gm::Right |gm::Top); $subframe->frames->[0]->growMode(gm::All); $subframe->frames->[1]->minFrameWidth(100); $subframe->frames->[1]->maxFrameWidth(100); $subframe->insert_to_frame( 0, #$subframe->firstFrame->insert( Edit => origin => [0,0], size => [$subframe->frames->[0]->size], growMode => gm::Client, ); $subframe->insert_to_frame( 1, ListBox => origin => [0, 0], size => [$subframe->frames->[1]->size], name => 'OtherUsers', items => ['Combo', 'box', 'salutes', 'you!'], growMode => gm::Client, ); #use Data::Dumper;die Dumper( $w, $frame, $subframe, $frame->frames, $subframe->frames ); run Prima; __END__