[pygtk] Actionable items, independent of the treeview's model
Darren Hart
darren at dvhart.com
Tue Mar 4 04:25:42 WST 2008
I'd like to include special rows in my treeview for things like creating new
rows, but I don't want to include that in the actual model as other widgets
use the model and should only render the real elements (no the special
action elements).
For example, say I have a TaskView
[-] Create new task...
[ ] Call doctor
[ ] Buy Milk
[ ] Ask pygtk hackers about actionable items
If the user clicks on "Create new task...", the text is cleared, and they
can type the name of the new task, on pressing Enter, a new task is created
and appended to the model, and the "Create new task..." remains at the top
of the view.
And then I have a combo box that lists the same items, but I don't want
"Create new task..." to show up in the combo box, but I'd like the two
widgets to use the same model.
I have considered wrapping the original model with a ActionableModel that
intercepts the *iter() routines, but was hopin there was a more generally
accepted approach to accomplishing this sort of thing. Perhaps something I
can do in the custom widets themselves?
-- =
Darren Hart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080303/a5f688dd/at=
tachment.htm
More information about the pygtk
mailing list