Today, I checked it about main_loop (GTK2 directly gtk2-> main) and the difference between Main_Iitration
If you are in the main loop and have a function which needs some time to execute, then it is a good idea to let the GUI update itself from time to time. Eg when you calculate something, and the calculation needs 20 seconds to finish, the app is blocked - you can not click anywhere to stop it or so If you stop your calculation every second and let the gui handle the events, it's a lot better, because the app responds to the user The events_pending / main_iteration is.. For this. Original: http://aspn.activestate.com/as/mail/MAESSAGE/PHP-GTK-GENERAL/2084492 It is probably that when you want to execute the code for a long time, call main will let the app hang. Start up
Main_IpectEration is to solve this problem. This is just in the program's main loop (not a UI LOPP) can be implemented but I found it in call
When MAIN_ITERATION calls main_quit, it will be reported: gtk-critical **: file gtkmain.c: line 1231 (gtk_main_quit): assertion `main_loops! = null 'failed at gui.pm line 34. How to see another code of:
$ window = gtk2 :: Dialog-> New ("Wget: $ desc", undef, []); $ window-> signal_connect ('response' => & exit_gracefully); $ window-> signal_connect ('close' => & exit_gracefully $ PID = Open (IN, "$ Command $ URI 2> & 1 |) OR DIE" Unable to Open Pipe: $! N "; # - EXIT On Button Press ---------- --------------------------- # SUB EXIT_GRACEFULLY {Print "Living to 0. Killing $ PID ... N"; KILL TERM => $ PID; KILL KILL => $ PID if kill 0 => $ PID; Wait; Print "... done.n"; $ living = 0; gtk2-> main_quit; exit;
I haven't seen it yet ...