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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to TK Scrollbars not working correctly by Popcorn Dave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-18 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found