Re: frozen GUI!!! urgent help required!



Michael,

you are not giving Gtk+ event loop a chance to run.
If you don't like thread programming (join the crowd),
then you can schedule a timer with Gtk+. When timer expires,
Gtk+ calls your callback where you can execute some
portion of your calculations. Needless to say, you would
probably have to rewrite your calculation procedure to
make it advance partially and be able to pick up next
time Gtk+ timer expires.

See Gtk-- Tutorial, "Ch. 15. Timeouts, I/O and Idle Functions"
on how to schedule a timer with Gtk+.

Good luck.

P.S. It might be worth of trying Idling Function instead.
Another possibility might be to fork(3C) a child process
that actually aquires an image from the camera, and when
aquisition is completed, send it back to your GUI via BSD socket IPC.
You can tell Gtk+ to monitor a socket and call your callback
when there is some data to read. This way you might get
the whole image back to your GUI at once.

-VLG

On Tue, Mar 12, 2002 at 02:55:47PM +0100, RevX gmx at wrote:
Hello all,

I've the following situation in/with my GUI (actually
I'm using Gtk--, but that shouldn't matter because
Gtk-- is only a wrapper for Gtk+):
A checkbutton gets pressed and calculations
begin (involving retrieving of images from a
video camera and processing them). And
at this moment the GUI is frozen, no buttons
are clickable anymore and the window isn't
redrawn when temporary overlapped by other
windows. It looks like as if everything is frozen.

So, what is going wrong??? Does the GUI of
Gtk+ not run parallel to the calculations to fetch
X events or is it a fault I just don't see?!
I hope someone can help me (soon).
Thanks for helping in advance.

Cheers,
Michael.

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



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