-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
adding global variable to keep track if gtkmain has been called #2604
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
Conversation
I don't think this is the best way to do this. I think it is far better to factor the |
@tacaswell I agree with you. As I said this is just a workaround the problem. If you want I can do the removal of the dependencies in Gtk3, just to see how it goes. At this moment, pyplot does know what figure manager and what canvas to use because My first questions Another point that comes to mind, pyplot has the My second question |
@tacaswell another question Is there any specific reason to get rid of |
Hello I have a preview working but I need some answers to know how do you want to reorganize the pyplot/pylab stuff. My little example is working calling figure, canvas and figuremanager form within my Gtk3 app, but of course without those helpers it is not of much use in scripting or interactive mode. I don't want to be too intense with this, but if we don't clear this from here, it will be impossible to move forward with other things, because this is always first in the list of modifications that you propose. |
The idea is to write a second layer of classes (which keep the current names, the current classes with Gcf and company stripped need to be renamed) that sticky tape together the backend |
Also, to be clear, you don't have to listen to my suggestions, if you think I am wrong explain why (or just ignore me ;)) Sorry if I am coming across as hostile, it is not intentional. |
@tacaswell I submited a first draft PR #2617 for review. |
When embedding plot creation in gtk (see example below)
The mainloop does not call
Gtk.main()
because it has been called by the embedder.But
Gtk.main_quit()
is called depending onis_interactive()
, it doesn't take in count who calledGtk.main()
This causes that the embedder program, gets destroyed when destroying the last window of the plots.
The proposed solution is just an ugly variable added to keep track if
Gtk.main()
was called inside the mainloop to restrict the call ofGtk.main_quit()
This may be related to PR #2503