Hi there,
just a quick question… I’ve got a GUI program doing some networking
stuff and want the GUI to react on what I get from my TCPSocket. To not
block the GUI when the server/connection is slow, I intend to extract
the networking stuff into a separate thread and then update the GUI
from that thread. So, can I for example do something like this:
@textview = Gtk::TextView.new
@textview.buffer.text = “Some initial text”
Thread.new do
sleep 5
@textview.buffer.text = “Some new text I got from somewhere else”
end
Continueing with other things in the main thread…
Is this possible or will I get segmentation faults or other unexpected
results? If not, are there any other possibilities to update widgets
from within another thread?
Valete,
Marvin
–
Blog: http://www.quintilianus.eu
ASCII-Ribbon-Kampagne () | ASCII Ribbon Campaign ()
- Stoppt HTML-E-Mail /\ | - Against HTML E-Mail /\
- Stoppt proprietäre Anhänge | - Against proprietary attachments
The Ascii Ribbon Campaign official homepage - Deutsch | www.asciiribbon.org