Re: fast timeout



On Sun Dec 27 07:16:02 1998 Andrea Bosio wrote:
> Hello all.
> 
> I need to update very frequently a canvas, and in meantime I need to still
> get control of my buttons in the app.
> For now the only solution I've found is to use gtk_timeout_add, but it's too
> much slow...
> 
> The ideal solution would be to fork and create a process which updates my
> canvas all the time, but I can't because of these damn
> Xlib: unexpected async reply (sequence 0x15a)!
> (Well: not using X resources I don't get them... but I can't do what I want).
> 
> Can you help me?
> 
> Ah... another question: is there a safe way to throw away all the contents of
> a canvas rapidly?
> For now I destroy its container. It's a bit slow and I get a warning message:
> 
> Gtk-CRITICAL **: file gtkcontainer.c: line 704 (gtk_container_remove):
> assertion `GTK_IS_WIDGET (widget)' failed.
> 
> It's container is directly app->contents .

I have a similar problem (that actually isn't fixed yet, but anyway...)
where I have a window which handles the user interaction and another
which handles the output.  The output window, at this time, is a plain X
window (I go directly to the display).  The routine that actually
handles updating the information for the window is added via
gtk_idle_add.  It stays there as long as updates are expected.  It also
should run at least as often as the screen refreshes unless the user is
doing a LOT of stuff with the interface.

This might be a step in the right direction, at least.  Take a look at
gpsui/gps-connection.{h,c}.  Towards the bottom of the file is a routine
idle_cb.  This routine is installed by the two routines following it.
This is in the latest version - 0.04.4 of my own struggling GNOME
project (trying to merge client/server model with GNOME and X window
programing and OpenGL - quite a bit).  Be warned that the X Window stuff
doesn't do what I want yet, so take what I do  with a grain of salt.
-- 
---------------------+---------------------------------------
Jim Smith            | Email: j-smith@physics.tamu.edu
Texas A&M University | http://people.physics.tamu.edu/jsmith/
Dept. of Physics     | Phone: (409) 845-1379
---------------------+---------------------------------------



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