Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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
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?
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 having an uproarious good time at the Monastery: (10)
As of 2015-07-28 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls