the container/table/scrollbar/adjustment problem to end all such problems



OK, I've had enough of trying to fix this problem over the years. Its
time to ask the rest of the experts how they would solve this.

The problem at hand is layed out like this:

                                     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    +--------------------------------+-----------------------------+
    |                                |                             |
    |                                |                             |
    |                                |                             |
    |              A                 |              B              |
    |                                |                             |
    |                                |                             |
    |                                |                             |
    +--------------------------------+-----------------------------+X
    |                                |                             |X
    |                                |                             |X
    |                                |                             |X
    |              C                 |              D              |X
    |                                |                             |X
    |                                |                             |X
    +--------------------------------+-----------------------------+X

the exact and relative dimensions don't matter at all.

the rules are that:

    * A never scrolls at all
    * B scrolls horizontally in step with D, but never vertically
    * C scrolls vertically in step with D, but never horizontally
    * (by implication) D scrolls vertically and horizontally

the area marked "XXXXXXXX" indicates the desired location of the 
scrollbar to control scrolling in the appropriate direction.

how to do this with GTK? i know the basics so please don't tell
me about using a table, etc. my existing (non)solution is:

   overall layout is a 3x3 table
   C is a layout containing an eventbox
   D is canvas widget (i.e. a layout, since canvas IS-A layout)
   B is a vbox containing several custom rulers and a canvas
   A is a vbox containing text labels stacked 
   XXXXXX is a scrollbar of the appropriate orientation

this is *very* close to working, but not close enough. I cannot
get the layout in C to scroll properly. it has its own adjustments,
but anytime the adjustment associated with vertical scrollbar is
changed, we set the layout adjustment to the same value. horizontal
scrolling works fine. the C layout will scroll, but any part of the
event box that was not visible when the top level window was mapped
will never be drawn.

suggestions? new approaches?

before you ask "why not use a scrolled window?", been there, done that.
GTK's scrolled windows do not support the idea of being limited in
display size but having no visible scrollbars. this means that C cannot
be a scrolled window because it will either (a) expand to the full size
of its child widget or (b) have to have at least 1 visible scrollbar.

--p





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]