[Glade-users] Getting data during a loop

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
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

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


Never miss a thing.  Make Yahoo your home page. 

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