#!/usr/bin/perl -- use strict; use warnings; use Tcl::pTk::TkHijack; use Tk; my $main_window = MainWindow->new( -bg => 'black' ); my $int = $main_window->interp; # Get the intepreter that was created in the MainWindow call $int->Eval(<<'__TCL__'); ttk::panedwindow .top_container -orient vertical ttk::panedwindow .world_container -orient horizontal -height 100 ttk::style configure . -background black ## fail ttk::style configure .top_container -background red ttk::style configure .world_container -background green __TCL__ my $top_container = $int->widget('.top_container'); # fail #~ $top_container->configure(qw/-background red /); my $world_container = $int->widget('.world_container'); $top_container->pack( -side => 'top', -expand => 'yes', -fill => 'both', -padx => '2m', -pady => '2', ); $world_container->pack( -side => 'top', -expand => 'yes', -fill => 'both', -padx => '2', -pady => '2m', ); $top_container->add( $world_container, -weight, 2 ); my $world_view = $world_container->Canvas( -bg => 'orange' ); $world_view->pack( -side => 'left', -fill => 'both', -expand => 1, ); $world_container->add( $world_view, -weight, 30 ); my $entity_view = $world_container->Frame( -bg => 'blue', ); $entity_view->pack( -side => 'right', -fill => 'y', -expand => 0, ); $world_container->add( $entity_view, -weight, 2 ); my $control_view = $top_container->Frame( -bg => 'yellow', ); $control_view->pack( -side => 'bottom', -fill => 'x', -expand => 0, ); $top_container->add( $control_view, -weight, 2 ); my $quit_button = $control_view->Button( -text => 'Quit', -command => [ 'destroy', $main_window ], ); $quit_button->pack( -side => 'right', -expand => 'no', -pady => 2, ); Tk::MainLoop();