Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Perl Tk::Pane

by Microcebus (Beadle)
on Jul 08, 2013 at 10:21 UTC ( #1043062=perlquestion: print w/replies, xml ) Need Help??
Microcebus has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I want to create a scrolled main window using Tk::Pane. But I have problems using the geometry manager 'place' to create my widgets. For example in the below code the button does not appear.
use Tk; use Tk::Pane; $main_window=MainWindow->new(-title=>"Program"); $main_window->geometry("800x600"); $main_pane=$main_window->Scrolled('Pane',-scrollbars=>'osoe',-backgrou +nd=>"GhostWhite",-sticky=>'n',-gridded=>'y')->pack(-fill=>'both',-exp +and=>1); $main_pane->Button(-text=>'EXIT',-command=>sub{exit;})->place(-x=>200, +-y=>200); MainLoop;
If I replace ->place(-x=>200,-y=>200) with ->pack() it appears. What am I doing wrong?

Replies are listed 'Best First'.
Re: Perl Tk::Pane (mixing geometry managers pack place)
by Anonymous Monk on Jul 08, 2013 at 13:22 UTC

    What am I doing wrong?

    You're doing something that Tk::Scrolled+Tk::place don't like

    If you want, this arrangement ought to be visible

    my $frame = ... my $button = $frame->...->place my $scrolled = ... $frame->pack( -in => $scrolled, ... );

    Tk really mysterious sometimes, esp managers

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1043062]
Approved by marto
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-10-25 23:29 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (330 votes). Check out past polls.