Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Perl/Tk scrolling question...

by graff (Chancellor)
on Apr 13, 2007 at 00:18 UTC ( #609797=note: print w/replies, xml ) Need Help??


in reply to Perl/Tk scrolling question...

So if the user scrolls horizontally to the "middle" of the day-of-week range, then scrolls vertically to the "middle" of the time-of-day range, both the day-of-week labels and time-of-week labels need to still be visible, right?

For that to work, I think you actually need three scrolling windows:

  • a "column headings" window that shows the day-of-week labels (has a height of one line), and only scrolls left-to-right;

  • a "row headings" window that shows the time-of-day labels (has a width of 5 characters: HH:MM), and only scrolls up-and-down;

  • the data grid table of 7 columns by however many rows (each cell is as big as you think necessary), and scrolls in all directions.

I don't have any specific coding examples handy, but I do remember that there's a way to set up callbacks on the scrollbars for a given scrolling window. The idea is that the scrollbars for the grid window will invoke call backs that will trigger an equivalent amount of scrolling in the x dimension on the column-heading window, as well as an equivalent amount of y-dimension scrolling on the row-heading window.

Shouldn't be too hard, once you find the right Tk man page (probably Tk::Scrollbar). Good luck with that.

(update: fixed the link and a spelling error, and wanted to add that you probably want to limit the number of visible scrollbars for all those scrolling windows -- display just one scrollbar for each direction -- and bear in mind that Tk lets the user to a "grab-and-drag" to scroll the grid window.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://609797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2021-12-08 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?