Welcome to the wacky world of Gtk generic models.
Take a look at the very bottom of _PeopleModel.py, there is a list called
COLUMN_DEFS, I believe that this maps to the member functions of PeopleModel
via the on_get_value method.
So you need to add a new method to render you column to PeopleModel, update
COLUMN_DEFS and add your column to column_names in PersonView.py.
This might not be a complete description but it should get you started.
As Don says we are planning a complete rework of the way that the models/views
and column management work in the near future. It may not make it any simpler
but it will be different :-)
On Thursday 08 February 2007 05:10, Douglas S. Blank wrote:
> Ok, that all makes sense. Where does the column name currently get
> associated with a function to get the data for the field? I've added my
> column, but it has the value (-1, u'').
> On Wed, February 7, 2007 11:50 pm, Don Allingham wrote:
> > PersonTreeView is not used in the design. It was a prototype for
> > something we have not shipped.
> > Look at DataViews/_PersonView.py for the current implementation.
> > However, we plan on changing this in 2.3. Richard Taylor and I have been
> > discussing removing the column specific stuff out of the model and into
> > the treeview, so that the column information is centralized.
> > Don
> > On Wed, 2007-02-07 at 23:41 -0500, Douglas S. Blank wrote:
> >> I need a little help as I've gotten stuck trying to figure out how you
> >> can
> >> add a new column to a view. The following are my guesses; please correct
> >> where I'm wrong, or point me to some documentation that I might have
> >> missed.
> >> Let's say that I want to add a new column, "Test", to the People view. I
> >> see that it looks like I need to alter
> >> _GrampsDbBase.GrampsDbBase.get_person_column_order so that it has some
> >> defaults. It looks like this tuple is:
> >> (show, column_num, width)
> >> where column_num is associated with a name. I'm guessing that comes from
> >> TreeView/PersonTreeView in cols. Further, it looks like there is a
> >> function associated with that col name. But PersonTreeView has a bunch
> >> of
> >> strangely coded methods that don't look like they are getting called.
> >> Can someone point me in the right direction? Thanks for any insight!
> >> -Doug
> >> ------------------------------------------------------------------------
> >>- Using Tomcat but need to do more? Need to support web services,
> >> security?
> >> Get stuff done quickly with pre-integrated technology to make your job
> >> easier.
> >> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> >> Geronimo
> >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> _______________________________________________
> >> Gramps-devel mailing list
> >> Gramps-devel@...
> >> https://lists.sourceforge.net/lists/listinfo/gramps-devel