in reply to Perl Tk Notebook not filling main window height

Like this?

#!/usr/bin/perl # http://perlmonks.org/?node_id=1191061 use strict; use warnings; use Tk; use Tk::NoteBook; use Tk::Pane; our $mw = MainWindow->new; $mw->geometry("800x1000"); # Create the NoteBook and add pages my $pane = $mw->Scrolled( 'Pane', -scrollbars => 'osoe', -bg => 'green', -sticky => 'nsew', )->pack( -fill=>'both', -expand=>1); my $n = $pane->Scrolled('NoteBook', -scrollbars => 'os', #-dynamicgeometry => 'true', )->pack( -fill => 'both', -expand => 1); create_tab("mytab $_") for 1..20; sub create_tab { my $tabname = shift; my $tn = $n->add($tabname, -label => $tabname, -underline => 0); my $t = $tn->Text(-wrap => 'none', )->pack(-expand => 1, -fill => 'both'); $t->tagConfigure ('bold', -font => [ -size => 0, -weight => 'bold' + ]); return $t; } MainLoop;

Replies are listed 'Best First'.
Re^2: Perl Tk Notebook not filling main window height
by madhusudhan_s (Novice) on May 25, 2017 at 10:51 UTC

    Thank you all for responding to my query

    The usage of sticky solution suggested by tybalt89 helped me.

    Here are the changes i made to the original code i pasted when i started this thread to get a neat solution.

    1. added use Tk::Pane; 2. Modified Canvas in mw->Scrolled to Pane 3. Added -sticky => 'nsew' in mw->Scrolled 4. Commented usage of $canvas->createWindow, ->update and ->configure 5. Modified occurrence of $canvas to $pane to ensure variable name matches usage
Re^2: Perl Tk Notebook not filling main window height
by zentara (Cardinal) on May 24, 2017 at 21:17 UTC
    Hi, I have to say your modification works perfect.... it looks like the better use of -sticky, :-)
    You had ,-sticky => 'nsew', which makes alot of sense for what the widget is doing.

    I'm not really a human, but I play one on earth. ..... an animated JAPH