Re: Adding a CellRendererCombo to a SimpleList



muppet wrote:

Not sure i follow in my groggy state.  CellRendererCombo inherits from
CellRendererText, so the text attribute is valid.  It's also perfectly
valid to use a subroutine for the attr (the manpage has an example).

Right. I must have been missing something else before, because I *am*
now getting -some- action with the text attribute.

SimpleList's column types are designed to map one column's value to
one cellrenderer's property; if you need two for the
CellRendererCombo, then, yes, you'll have to do something manual.

AFAIK I only want one cellrenderer's property: the ID stored in the
combo's model. This is proving to be difficult. I can only seem to set
the text column ( the *other* column in the model, not the ID column ).
For example, I'm pulling primary keys and associated strings from a
database. My CellRendererCombo is displaying the primary keys instead of
the strings ( ie when not activated ). But when I click on the Combo, I
get the proper list of strings. Going back the other way, if I use the
Combo to choose a value, the *string* is going back into the simplelist
instead of the primary key.

Note that it should be possible to use the SimpleList's TiedList class
to tie a model, and use that model with your own view implementation. 
(The real attractive feature is the tied behavior, after all.)

You've completely lost me here. I've looked at the source and ... well
... that didn't help any :(

I'm attaching what I've got so far - the module and a demo application.
People won't be able to *use* the demo application because it depends on
my database, but hopefully someone can see what I'm doing wrong from the
source anyway. I can provide some test data in arrays in the source or
something if people want - I suppose I'll have to for the demo app when
I actually get something working and released, but I've been distracted
by other problems now anyway.

Of course if others who are interested in the module have any
suggestions for the general direction I'm going in, feel free to offer
thoughts / feature requests. Once I get this combo thing working, I'm
actually pretty damned close to a working solution. I've got code to do
the updating to the DB sorted already.

Help greatly appreciated :)

Dan

Attachment: test_datasheet.pl
Description: Perl program

Attachment: DBI.pm
Description: Perl program



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