Everytime I searched to delete one element from the list, the deletion of that element from internal db doesn't work... instead it was deleting another element.
The code was something like that:
- get the iterator and model , for the selected element of the treeview.
- remove the element from the model giving the iterator.
- the iterator became invalid...(yes it is deleted!) so I did the same thing of step 1.
- remove the element form the db getting the key from the iterator.
So the code changed like this:
- get the iterator and model , for the selected element of the treeview.
- remove the element form the db getting the key from the iterator.
- remove the element from the model giving the iterator.
Now add and delete of stocks works.
The other problem is with pygtk and thread.. As I mentioned before.. everytime the application try to connect to the web the interface freeze until this operation is complete.
This happened because retrieving data from the net, it is a blocking operation, and block the main thread where the GTK engine runs.. so the application freeze.
I read so many pages about which is the best way to implements a Thread.. and I hope to be near to a solution.. but not yet!
No comments:
Post a Comment