-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOSX backend #11
Comments
This requires fixing |
@ViralBShah, graphics are supported on MacOSX via Qt or Gtk, it is only wx that doesn't work. However, I think @nfoti was referring to matplotlib's "native" MacOSX Cocoa backend. I looked into this, but unfortunately I didn't see any straightforward way to implement the Cocoa event loop from Julia (especially since Cocoa's event-loop routines seem to require Objective C). |
I was referring to the matplotlib's MacOSX backend. If it's a huge pain to implement then it's not a big deal. It just is nicer than QT on OSX. Thanks. Sent from my iPhone On Aug 16, 2013, at 7:10 AM, "Steven G. Johnson" [email protected] wrote:
|
I agree that it would be nicer, I just can't figure out any way to support its event loop in a non-blocking way. IPython doesn't seem to support it either, probably for the same reason. (@minrk, do you know anything about this?) |
IPython does support the OS X backend. We use a matplotlib Timer object to put our |
Hmm, it doesn't really seem acceptable to have Cocoa in charge of the event loop and to call Julia occasionally; it should be the other way around. Otherwise we lose Julia's ability to process other tasks asynchronously. cc: @JeffBezanson What I looked for, and couldn't find, was some Cocoa function to process pending events and then return, similar to how we handle other toolkits now. Am I missing something? |
inputhook is only for single-process terminal IPython - there is no inputhook in the Kernel. |
If you find such a thing, it would certainly be preferable to the inversion of priority that IPython does currently. |
Hmm, it looks like CFRunLoopRunInMode, passing seconds=0.0, might do the trick, i.e. something like:
Doesn't seem to be working though; I must be missing something. |
Even without the official OSX background, is there a way to get this running on OSX? I use Anaconda Python and have tried all sorts of things, but continue to get various errors. If you would like more info, just let me know. |
I run it on MacOS X. If you install things yourself using Even with Anaconda, it works fine in IJulia for me, thanks to commit 8599ca0 |
Thank you @stevengj. I have had problems with Anaconda running some of my PySide applications in the past so I am sure it is related to the broken qt. I'll try one of my other python environments. |
Not sure if this is still a problem, but upgrading to the latest anaconda version finally allowed me to use PyPlot. |
Good to hear, @grero! |
I'm having this issue. I've tried many things with no luck:
Any help would be greatly appreciated. |
For future reference, this discussion (TooTallNate/NodObjC#2) of integrating CFRunLoop with libuv's event loop may be useful. |
Concerning the email exchange below, I'm finally back in a position to work on this. My first inclination after looking at the Julia code is to eliminate the dissonance with libuv by replacing it with the core foundation runloop - or the Cocoa runloop depending on what is needed to make Julia a more MacOS as opposed to a darwin app. There is such a small amount of code that it shouldn't be hard to create a prototype version of Julia. Steven - if you post or mail me the code you mention on 8/20/13 I'll use that as a test case. It would also better help me understand what is wrong.
|
The (non-functional) code that I mentioned is in the |
There is code for making the timer based sharing of a TTY interface and event loop driven (cocoa) GUI in a single thread in the python mac specific folder - it’s similar to what you have in PyCall but I don’t think it’s exactly the same. I can pursue that but I’d also like to discuss the pros and cons of going for a more general solution. A few caveats - I have had trouble building julia-0.4 which has slowed down figuring out the scope of the issue the PyCall has with the cocoa code/guis. I’m assuming that a similar issue exists with julia directly calling dynamic libraries with GUI code vis-a-vis those referenced through python modules. I also can’t say for sure yet why some of the window managers work with the scheme you’ve implemented. (A guess is that the cocoa code in PyCall may be creating a “nested” event loop that isn’t running). So, I hope I’m not too badly jumping the gun. If julia could be configured with event loops from a particular window manager, and the input and basic processing implemented with a bit of multi-threading, the combination should eliminate the issues with trying to run julia (and presumably ijulia or python) and a gui in a single thread. I'm willing to prototype a cocoa version of julia to test before the idea is broached to the julia development community. My first thought is to make the OS X configuration of Julia use the corefoundation (nee Cocoa) event loop running in the default thread. To keep that from blocking, monitoring STDIN could be moved to a second thread and Julia itself to a third thread. The devil is in the details but I don’t see this being a gigantic change. What do you think? Stephen
|
If you want to rewrite the event loop of Julia itself, I would discuss it on the julia-dev mailing list; it's not really a PyPlot question. |
Do you think it's possible to support the MacOSX backend?
The text was updated successfully, but these errors were encountered: