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

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?

Comment on Perl Tk::Pane
Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2014-08-29 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (286 votes), past polls