in reply to TK Scrollbars not working correctly

For starters, your description is a little confusing: you have a 800 (wide) by 600 (tall) frame, and you place a canvas inside this, with a max size of 300 x 300 (possibly smaller on one or both axes, depending on the GIF to be loaded), you have a mandatory scrollbar at the bottom of the canvas, and an optional one along the right side. Then, you say that you load a 200 x 700 image, which should mean 200 wide, 700 tall, and you say that you don't get the side scroll bar, which is what you expected. (?? -- Did you really mean that the image is 700 x 200? What happens when you load an image that needs the vertical scrollbar?)

Anyway, I gather that the bottom scrollbar is spanning the full width of the frame that contains the canvas (800 wide), which certainly seems wrong -- although you say it actually does scroll the image as intended when you click on its various elements.

I don't have a direct answer to the sizing problem, but I would point out that you could (probably should) combine the two "-scrollbars" parameters into one:  -scrollbars => 'sow', -- sorry if that turns out to be off the mark... Apart from that, have you confirmed that the "$height" and "$width" variables actually have the expected values (as opposed to, say, zero or undef)?

Replies are listed 'Best First'.
Re: Re: TK Scrollbars not working correctly
by Courage (Parson) on Jan 22, 2003 at 06:59 UTC
    Provided the way Tk processes passed arguments, one *must* combine same parameters into a single one, otherwise only latest will be in effect.

    Most probably you pointed exactly at the problem place.

    Courage, the Cowardly Dog

Re: Re: TK Scrollbars not working correctly
by Popcorn Dave (Abbot) on Jan 23, 2003 at 04:48 UTC
    Sorry if it was a bit confusing. I do have an 800 x 600 Tk window with a canvas that defaults to 300 x 300 if the image is larger than that, or is sized at the graphic's actual size if it's smaller than 300 x 300. (Yes I did mean it was 700 x 200)

    I do know that the height and width are coming in correctly as I'm pulling those values right from the gif file itself.

    You're on the mark with the -scrollbars => 'sow' I know that, however when I tried to use -scrollbars => 'osow' both scrollbars disappeared. That's why I thought to put them as seperate items.

    Thanks for the idea though. Back to the books I guess. :)

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