Note that there are some explanatory texts on larger screens.

plurals
  1. POPyGTK and threadings
    primarykey
    data
    text
    <p>I'm kinda' new in Python, I'm learning it by myself and all I have to say is that it's a wonderful programming language. Even if I'm learning it in the straight way, for now I know (as a beginner) how to work with GTK, threads, urllib and other modules.</p> <p>But I need an answer from experienced PyGTK users. Take a look to this little example in the image:</p> <p><a href="http://i.stack.imgur.com/y10nv.png" rel="nofollow">http://i.stack.imgur.com/y10nv.png</a></p> <p>In this concept application (it doesn't have a working code) when the user will select a row from Gtk.TreeView I will show some row-specific data taken from the web (URL differ for each row). So when the user click on a row, a thread is started (to not froze the GUI) getting the data from an URL. When data was succesfully fetched, a callback is called displaying the content in the Gtk.Label placed under the list.</p> <p>The problem is that if the user quickly selects some different rows, well... there will be a little mess because some requests may take longer than others and there will be a "desynchronization" between the selected row and the data displayer in Gtk.Label. I know that a running thread can't be stopped from outside (even that I found a thread module that make this possible), so what's the best way to prevent the Gtk.Label being desynchronized with the current selection?</p> <p>I'm sorry for my bad english and for my silly question. Currently I managed to fix this by comparing the text in the selected row with what I expect to get from the requested URL, but I think there is a better way to manage this.</p> <p>Thank you very much, Ovidiu Nitan</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload