GtkTreeView signal before row change




Hi:

I have a situation where I need to verify data before allowing a row change in a GtkTreeView. Essentially:

1. User requests a row change through a keyboard or a mouse;
2. Check if data in the current row has been edited without be saved, or even is complete 
and valid, and prompt the user appropriately;
3. Depending on user request, I may need to veto the row change request (aka cancel)

What's the best practice?

A possible way is use "cursor-changed" signal
1. always remember the current row (possibly by store a GtkTreeIter)
2. in the cursor-changed signal handler, check if on the same row and go back to original row by way of 
stored GtkTreeIter if necessary.

Is there a better way? Tell me how you would approach this please.

Thanks,

Lance
                                          


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