Re: Scrollable Widgets

Hello all,

I've been following the recent discussion between Owen and Tim about
scrolling in Gtk+. It's been a little over my head, but I want to make
known a concern I have anyway.

Briefly, I'm concerned that if the gtkviewport widget goes away, I
will not be able to implement a particular application that demands
more from scrolling than what I understand gtkscrolledwindow provides.

My application is a non-destructive digital audio editor rather like
Digital Performer on the Mac (though with much less functionality).
The main window displays any number of audio tracks, stacked vertically.
Each track has its own control panel on the left side of the window.
Its waveform display appears to the right of this control panel.

Here's an ascii picture of the part of the window I'm describing.

| track 1     | waveform display for track 1                         | ^ |
|             |                                                      | : |
| mute  solo  |                                                      | : |
| [and other  |                                                      | : |
|  buttons]   |                                                      | : |
|-------------|------------------------------------------------------+   |
| track 2     | waveform display for track 2                         | s |
|             |                                                      | c |
| mute  solo  |                                                      | r |
| [etc.]      |                                                      | o |
|             |                                                      | l |
|-------------|------------------------------------------------------+ l |
| track 3     | waveform display for track 3                         | b |
|             |                                                      | a |
| mute solo   |                                                      | r |
|             |                                                      |   |
|             |                                                      | : |
|-------------|------------------------------------------------------+: |
| track 4     | waveform display for track 4                         | : |
|             |                                                      | : |
| mute solo   |                                                      | v |
|             |<===================== scrollbar ====================>|   |

There's a horizontal scrollbar that scrolls _just_ the waveform
display section, because I want the control panel section to stay in
the same place always (on the left side).

There's a vertical scrollbar that scrolls _both_ the waveform display
section and the control panel section.

So the user would scroll down to see more tracks and scroll right or
left to place a different time range in the waveform display.

I've implemented this using one gtktable for the control panel section
and one gtktable for the waveform display section. I drop each table
into a gtkviewport. Both the viewports are connected to the vertical
scrollbar, so that vertical scrolling is a no-brainer for my application.

I connect the horizontal scrollbar only to the waveform display
viewport. (Handling the horizontal scrolling is much more complicated,
because I implement zooming, and because a totally zoomed-in view
can easily overflow the Xlib coordinate space.)

My experience with Gtk+ is fairly limited, but I don't think I could
manage what I have above with a gtkscrolledwindow. I think I need
separate access to gtkviewports. I welcome any thoughts anyone has
about a better way to implement what I've described.

I think it's important to consider concrete examples before any
substantial redesign, so I'm just offering my description in
that spirit.

(And thanks, Owen and Tim, for all your great work on Gtk+.)


John Gibson
Virginia Center for Computer Music

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