in reply to Re^4: how to set tab order in the perl tk?
in thread how to set tab order in the perl tk?

To be honest, I can't figure out what you are trying to do? What is it supposed to do? I can't decipher your table1 and table2 logic with packforget. Make a simpler example, and state exactly what you expect it to do.

At a quick glance, if you comment out your $mw size restrictions, the scrollbars work.

#$mw -> resizable (0,0); #$mw -> geometry ("+10+10"); #$mw -> geometry ("750x500");
this indicates you have a packing problem.

I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^6: how to set tab order in the perl tk?
by kapsule (Acolyte) on Dec 25, 2008 at 05:26 UTC
    Actually, packforget is used to make that table invisible, when that button is pressed again. It means at the first press of button table will appear and in the next press of button table will disappear. Well I cannot comment out my size restrictions, because the moment i do that whole window become so small (of course with scroll), but it does not serve my purpose. I want my first table and following buttons to be shown by default, and when "new names" button is pressed a table should appear with a scrollbar (in main window) having default focus. I think this will make the things clearer.
      Well, I'm not sure this is the best solution, but it works. You can't have the -expand=>1 -fill=>'both' on the $spane, it interferes with the scrollbar calculations. And you need to set a height for the Pane. There probably is a way to calculate the needed height, but I just hard coded in 400 pixels.
      my $spane = $mw->Scrolled('Pane', -scrollbars => 'oe', -height => 400, -bg => "orange", )->pack(); my $yscrollbar = $spane->Subwidget('yscrollbar'); $yscrollbar->focus; #makes up/down arrows control scrollbar

      I'm not really a human, but I play one on earth Remember How Lucky You Are