#!/usr/bin/perl -- use strict; use warnings; use Tk; use Tk::IDEpanedwindow; my $main_window = MainWindow->new( -bg => 'black' ); my $top_container = $main_window->IDEpanedwindow( qw/-orient vertical -sashpad 1 -sashwidth 3 -sashrelief groove -bg red/); $top_container->pack( -side => 'top', -expand => 'yes', -fill => 'both', -padx => '2m', -pady => '2', ); my $world_container = $top_container->IDEpanedwindow( qw/-orient horizontal -sashpad 1 -sashwidth 3 -sashrelief groove -bg green / ); $world_container->pack( -side => 'top', -expand => 'yes', -fill => 'both', -padx => '2', -pady => '2m', ); $top_container->add( $world_container, -expandfactor, 1, ); my $world_view = $world_container->Canvas( -bg => 'orange' ); $world_view->pack( -side => 'left', -fill => 'both', -expand => 1, ); ## sometimes factor 3 is too much, sometimes not enough # $world_container->add($world_view , -expandfactor,3 ); $world_container->add( $world_view, -expandfactor, 10 ); my $entity_view = $world_container->Frame( -bg => 'blue', ); $entity_view->pack( -side => 'right', -fill => 'y', -expand => 0, ); $world_container->add( $entity_view, -expandfactor, 1, -minsize => 100 ); # SASH limits); my $control_view = $top_container->Frame( -bg => 'yellow', ); $control_view->pack( -side => 'bottom', -fill => 'x', -expand => 0, ); $top_container->add( $control_view, -expandfactor, 1, -minsize => 60 ); # SASH limits); my $quit_button = $control_view->Button( -text => 'Quit', # -command => sub { $main_window->destroy }, # -command => ['destroy', $main_window ], -command => 'exit', ); $quit_button->pack( -side => 'right', -expand => 'no', -pady => 2, ); $main_window->WidgetDump if @ARGV; Tk::MainLoop();