Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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
beech testing in the sidebar
beech *me* me *me
beech *me* ... test
[beech]: ...
beech me *me* ... test me *me* test
[beech]: me
[beech]: ... test

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-03-28 23:42 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (343 votes). Check out past polls.