From: Ethan M. <merritt@u.washington.edu> - 2007-03-30 19:14:43
|
On Friday 30 March 2007 10:41, Timoth=E9e Lecomte wrote: > So there is one remaining thing to try, but this will involve more work on > my part: changing the way wxt works on Unix and Mac and arrange it so that > the main thread runs the event loop while the usual gnuplot command-line > loop runs in the separate thread. Won't this prevent switching to another interactive terminal type? Sounds to me that Cocoa is broken by design. Given this design limitation, I suspect it would be easier/better to use the gnuplot+gnuplot_x11 model. Instead of running wxt as a daughter thread, spawn a separate process for which it is the main thread. Ethan > Dear Mojca, Joe, and all gnuplot enthusiasts, >=20 > Here are some news about the availability of the wxt terminal for the > MacOS platform. I have had the chance to get my hands on my MacBook and I > have worked a little bit on the issues you got when trying to use the wxt > terminal. >=20 > To sum up where we were last time we talked about it: >=20 > - building seems to be ok. The most painful part is to build recent enough > (i.e. using Fink) glib, cairo, pango & wxWidgets. Fortunately, this is > almost to be done the Unix way, 'configure; make; make install'. The > exceptions are to disable features for cairo so that it doesn't ask for > Freetype or fontconfig (useless here). >=20 > - executing gnuplot and trying to use wxt, you successfully get plot > windows, but those seem to be "dead". The mouse changes to a colorful > pinwheel, the buttons on the top (close, minimize, maximize) are grayed > out, and you cannot grab the window to move it. >=20 > - from my researches, "bundling" is necessary, but it didn't seem to > change anything when done on gnuplot. >=20 > So, I've investigated regarding this problem: > - bundling is indeed necessary. I wrote a sample wxWidgets app, and tried > to launch it without bundling it. It doesn't get the focus. BUT the mouse > cursor stays the same, and the buttons on the top bar do work. So it's not > really the root of the problem with the wxt terminal. >=20 > - I tried on the sample app what is the second most important aspect of > the wxt implementation: putting the event loop in a separate thread. And > bingo ! I get the same problem as with wxt... Although the separate thread > and its event loop are running, the latter does not process the window > events. It turns out that this is a limitation of Cocoa app (MacOS > programming toolkit): > "The main thread of the application is responsible for handling events. > The main thread is the one blocked in the run method of NSApplication, > usually invoked in an application=92s main function. " > (http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading= /articles/CocoaSafety.html) >=20 > I've searched for this "run" method in the wxWidgets code, but could not > find it. MacOS development involves a mixture of layers called Foundation, > Cocoa and Carbon (like GLib, Cairo, GTK and friends) and I'm afraid this > 'run' method is in fact hidden somewhere else. Anyway, I tried to do as > much initialization as I could in the separate thread, but it didn't work > either. >=20 > So there is one remaining thing to try, but this will involve more work on > my part: changing the way wxt works on Unix and Mac and arrange it so that > the main thread runs the event loop while the usual gnuplot command-line > loop runs in the separate thread. The challenge is to do that only when > wxt_init() is called, not before (doing it at startup time is easy, but I > don't feel like it would be the right way). > (note that on Windows we don't have this problem because the fake terminal > already has the event loop and runs gnuplot command loop inside it) > (as far as aquaterm is concerned, it has another design again, something > like the X11 terminal: the GUI is in a different program with its own loop > and talking with gnuplot through some interprocess communication > mechanism) >=20 > If some of you feel some inspiration regarding this issue, I would > appreciate to listen to them ! >=20 > Best regards, >=20 > Timoth=E9e Lecomte >=20 >=20 > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta >=20 =2D-=20 Ethan A Merritt Courier Deliveries: 1959 NE Pacific Dept of Biochemistry Health Sciences Building University of Washington - Seattle WA 98195-7742 |