Re: [gtk-list] Re: Scrollable Widgets



On Sat, 17 Oct 1998, John Gibson wrote:

> 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.

hm, interesting, i implemented the same layout for a pattern editor in an
audio application i'm working on, but designed the whole thing as a composite
widget using seperate gdk windows.

> 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.

ok thanx, you actually gave a good and valid reason to keep the GtkViewport
widget. i just had not encountered a valid application of its code solely
so far. actually i'm not on a vandetta to kill the viewport widget in gtk,
but to have the scrolled window integrated nicely into the widget tree, without
the viewport-container-forwarding magic it currently does, thus make it provide
scrolling abilities itself.

[owen, i was following our discussion on gtk-devel-list only up till now,
 that's why i hadn't seen john's example yet]

> 
> best,
> John
> 

---
ciaoTJ



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