This is driving me nuts ... I have made a little progress but not much.

At the moment I am stuck trying specify a row selection within the "toggle" callback from the a CellRenderToggle. My code is:

def on_cell_toggled(cellrenderer, path, model, view):
treeselection = view.get_selection()
last_path = treeselection.get_data('last_selected_row')

# if the row that the toggle is on is different from the
# previously selected one, select the previous row
if not treeselection.path_is_selected((int(path),)):
treeselection.select_path(last_path)

The trouble is that treeselection.select_path(last_path) doesn't seem to do anything (it seems to change the selection okay, but not the view itself...

Help would be greatly appreciated.

thanks

Richard
.

Hi all

I am hoping that someone will be able to help me out. What I want to do
is to create a treeview (a list really) where one of the columns is a
toggle button i.e. like in the list_store.py demo.

The catch is that I want to be able to toggle the buttons _without_
having the row actually being selected -- I want the current row
selection to be preserved (as the Gimp's Layers dialoge when you go to
select the active dialog).

At the moment I'm not having much luck. I can't even find a callback
that lets me know when a row as being activated...

Any help/suggestions would be greatly appreciated

thanks

Richard



_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to