[Glade-users] Getting data during a loop
- From: westli1 at yahoo.com (dj)
- Subject: [Glade-users] Getting data during a loop
- Date: Sat, 23 Feb 2008 23:21:59 -0800 (PST)
Thanks, Tristan.
I'll work on it with your suggestions.
--- Tristan Van Berkom <tvb at gnome.org> wrote:
On Sat, Feb 23, 2008 at 11:31 PM, dj
<westli1 at yahoo.com> wrote:
I am working on a program for controlling my
shortwave
receiver using Glade, pyGTK, and python.
Hi, this is a gtk+ related question and would be
better targetted
at gtk-app-devel-list at gnome.org, however, the
problem you are
experiencing is simply put, during the routine in
which you are
reading and printing to the console and updating a
treeview, you
are never returning to the main loop, and so since
you never return
to the main loop the GUI updates are never
processed.
Generally you would have some kind of data handler
(a GIOChannel
possibly) and handle a bit of data at a time and
always remember to
return ;-)
other ways of dealing with this include using
GThread (I dont think
you need to deal with that), or the famous old:
while (events_pending())
itteration_do ();
which might be better for you, if you are writing
new code though I
would suggest you handle the data in itterations and
get used to
proper single thread event based programming
(especially if event
flow is important in your app, you might try staying
away from too
much hacked out recursive envokation of the main
loop).
Cheers,
-Tristan
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]