Re: Need some help with GUI design: 2 header rows in a treeview



Daniel Kasak wrote:
Ed Catmur wrote:
Keep the button bar outside the GtkScrolledWindow; put the GtkTreeView in the GtkScrolledWindow as before.  Instead, stick the button bar in a GtkViewport with its hadjustment set to the hadjustment of the GtkScrolledWindow.  You'll need to mess around with size-request and size-allocate signals to ensure the GtkViewport gets the correct width and height.
...
I've had a little trouble figuring out which signal to use to synchronise the 2 hadjustments. The only thing that works for me at the moment is the ScrolledWindow's 'event' signal, but as you can imagine, this is a pretty noise one to connect to. The ScrolledWindow's 'scroll-child' signal doesn't seem to fire for me. Am I missing something here?

Don't use a signal; have the GtkViewport and the GtkScrolledWindow use the _same_ hadjustment.

i.e.:

$viewport->set_hadjustment($scrolled_window->get_hadjustment)

Magic!



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