Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

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

In reply to Re: Perl/Tk scrolling question... by graff
in thread Perl/Tk scrolling question... by jdtoronto

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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2023-02-07 12:22 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (39 votes). Check out past polls.