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



Daniel Kasak wrote:
I'm working on a data entry form that would *really* benefit from having 2 rows of headers for the treeview.

I've done this sort of thing before with treeviews where all the columns fit in the treeview without scrolling, by having an hbox filled with buttons immediately above the treeview, and then just resizing the buttons when the treeview is resized so the buttons line up with the columns they're supposed to go above. This actually doesn't look too hacked up :)

I've tried to reproduce this method with my current treeview, which scrolls way out to the right, but I've hit a problem. I can't actually put the hbox pull of buttons inside the scrolled window, because if I do, the scrolled window ceases to operate as a scrolled window - the treeview isn't scrollable. I assume you can't do this. What, then, do I do?

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 thought the docs explained this fairly well, but maybe that's just me :)

From an aesthetic POV, the buttons might look better with relief set at half or none, btw.



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