http://qs321.pair.com?node_id=228948

Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

A while back I wrote an image map program in Perl for a project in a Perl class I took. Well I went to use it on a large graphic the other day and discovered a minor flaw, so needless to say I'm in the process of fixing it now. :)

My problem is with the scrollbars. They are showing up as advertised, but they're filling the entire canvas space and I can't figure out exactly how to set it to a percentage of the canvas width.

My frame is set to 800 x 600, and the canvas is based on the size of the GIF file that it's reading. If it's larger than 300 pixels either way, the value is set to 300 pixels.

The code I'm working with is this:

my $tcanvas=$top->Scrolled("Canvas", -scrollbars => 'ow', -scrollbars => 's', -bg=>'white', -height=>$height, -width=>$width, -border=>0, -cursor=>'crosshair', )->place( -x=>325, -y=>30, ); my $canvas = $tcanvas->Subwidget("canvas");

My graphic is about 200 x 700 and when I try it with the program, I get the bottom scroll bar, but not the side bar, which is what I would expect as I've set it that way. But the bottom scrollbar fills the entire area on the bottom. Using the arrow bits on either side does move the graphic along fine.

Is there something that I haven't set in my scrollbar? I looked in the Perl/Tk book but that wasn't much help unless I overlooked something obvious.

Thanks in advance!

There is no emoticon for what I'm feeling now.