Need some Gtk help

Phil Longstaff phil.longstaff at
Sat Jul 27 10:18:41 EDT 2013

For Gnucash 2.5/2.6, I'm working on the budget display.  In 2.4, the budget display is a single account tree with one extra column per budget period (e.g. month).  To this, I am adding a column for row totals (budget year totals).  I am also adding some new rows with column totals for total income, total expenses, total transfers (to asset/liability) and month totals (income - expenses - transfers).

So, I am changing the display to a 6-item display:

- top left: account tree with just account names
- top middle: budget columns with 1 column per period
- top right: column with row totals
- bottom left: labels (total income, total expenses, total transfers, total)
- bottom middle: column totals with 1 column per period
- bottom right: row totals of column totals

In the budget plugin page itself, I pulled the display out into a new GncBudgetView widget which the plugin page just attached to.  It sends some signals which the plugin page reacts to in a similar manner that it used to.  This allowed me to just work inside the GncBudgetView to get the structure I want.

I can get the content I want for each section, but I can't get the sizing/scrollbar behaviour I want.  My requirements:
- the bottom sections should be fixed size (vertically) since there are 4 fixed rows
- the top sections should take up the rest of the size (with an appropriate minimum so it doesn't collapse to nothing) and add a scrollbar when appropriate
- the three top sections must scroll vertically together
- the top middle and bottom middle sections must scroll horizontally together.
- the top and bottom right sections (row totals) are fixed size and don't scroll
- the top and bottom left sections (account names/labels) should have a min size and account names would only need a horizontal scrollbar if there were a really deep hierarchy and/or really long name

What I'm finding is that if I expand in the account names section, my main window grows so that no scrollbar is needed, pushing info off the bottom of the screen.  This doesn't happen in the main account window, for example.  How do I get the GtkViewport or GtkScrolledWindow to push back?  I've read the sections of the manual but haven't gotten anything to work.


More information about the gnucash-devel mailing list