Re: Gtk2::SimpleList




On Monday, May 31, 2004, at 02:24 AM, Daniel Kasak wrote:

At least I know what I *can't* do ;)

there's nothing you can't do! just depends on how sophisticated you make your code (and, possibly, how slow you're willing to let it run ;-)

(it is rather easy to get SimpleList to use custom renderers, by creating new column types.)

So does that mean I can do all the validation *and* database synchronisation in custom cell renderers, and then just drop the renderers into a SimpleList?

i don't think you'd necessarily want to do database interaction in your cell renderer. you're quite safe leaving that at the row level, managed by the list handling code. the sort of validation i was talking about is making sure numbers are in the right range, that strings do not exceed a certain length, enums contain valid values, etc. these are all things that you can set up on a per-column basis, often from the table description; you don't really need cell granularity for that.

if you set up a bunch of renderers that can validate the user's input at that low level, then you can be comfortable that when the row-changed signal fires, you have a decent set of data in the changed row that you can then update in the database.


I will, however, have a look at TreeView / ListStore stuff. Maybe I should learn that too?

even if you continue to use SimpleList, it will not hurt you at all to learn how TreeView and ListStore work together. besides, if you want to use a tree, you have to use TreeView and TreeStore. it's actually not hard, just takes a bit of messing about to figure out what everything does. there's an excellent treeview tutorial linked from the gtk2-perl website's "links" page; it's written for C, but it's fairly easy to figure out the corresponding perl.

--
Holy crap, dude, we have kids!
        -- Elysse, six days after giving birth to twins




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