[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: "wxt on Mac": news
From:       Timothée_Lecomte <timothee.lecomte () ens ! fr>
Date:       2007-04-28 13:35:44
Message-ID: 46334DB0.2090808 () ens ! fr
[Download RAW message or body]

Timothée Lecomte wrote:
> Dear Mojca, Joe, and all gnuplot enthusiasts,
>
> 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.
>
> (...)
>
> 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)

Hey people, here are some more news about "wxt on Mac". I've found some 
time yesterday to investigate a little further. I found that wxMac has 
some limitations :

- the GUI thread (i.e. the one running the GUI event loop) has to be the 
main thread. I had some success making the second thread be the GUI one, 
but still a lot of issues come after that, because:
- GUI calls should all be done in the same thread. With wxGTK, there's a 
mutex locking mechanism, but it seems that it's really not working on wxMac.

So far, I was able to make wxt work by :
-at startup, first initialize wxWidgets
-create a second thread that run gnu_main (otherwise called main in plot.c)
-start the event loop in the main thread
and use messages to tell the GUI event loop to do something, instead of 
doing it directly in the second thread.

(it may seem very close to a two process-scheme, such as what is done 
for the X11 terminal, but I don't want to have to deal with 
inter-process communication, or fork+exec for now ;)

So, it's working !

The drawback is that there will be problems if, one day, we want to do, 
for example, a GTK terminal with a similar design... there may be some 
sort of clash between the two wanting for their main loop be in the main 
thread... but that day is probably quite far !

I'll be cleaning up the corresponding patch in the next days if I have 
some time again, and I'll send it to the list as soon as it's ready.

Best regards,

Timothée

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic