"be consistent" | |
PerlMonks |
Tk::Canvas too wide for MainWindowby benizi (Hermit) |
on Jul 23, 2005 at 15:28 UTC ( [id://477489]=perlquestion: print w/replies, xml ) | Need Help?? |
benizi has asked for the wisdom of the Perl Monks concerning the following question: I have a Tk app that basically consists of a Tk::Canvas inside a MainWindow. (It's a simple, hacked-together tool to display graphs of some data I'm using.) For simplicity, I've made the Canvas as many pixels wide as the number of data points in the graph. Some of my graphs, though, are wider than my screen's resolution (~2700 data points vs. 1600 pixels), so I tried simply constructing the Canvas with the Scrolled constructor. Unfortunately, the scrollbar doesn't seem to "realize" that the Canvas isn't fully displayed. Much-reduced version of the problem below: Reduced version draws a sawtooth-like graph, with three peaks, first of which should be visible, next two should be scrolled-to. Desired outcome: 1000x500 pixel MainWindow with portion of scrollable 3000-pixel-wide Canvas visible. Current outcome: 1000x500 pixel MainWindow. Scrollbar indicates 100% of Canvas visible. (Stretching window reveals rest of Canvas.)
Update: Solved per pg's help (see: Re: Tk::Canvas too wide for MainWindow). Thanks. Update 2: Corrected code, per chanio's suggestion.
Back to
Seekers of Perl Wisdom
|
|