[Matplotlib-users] matplotlib in GTK3 - interactive window while not calling Gtk.main()

michalwd1979 michalwd1979 at o2.pl
Sun Apr 22 16:43:23 EDT 2018


Dear Members,  Recently I upgraded to from matplotlib 1.4.3 + gtk2 to matplotlib 2.2.2 + gtk3 and I have a problems with porting my old code.  I'm using matplotlib in Gtk window with typical:  win = Gtk.window()  vbox = Gtk.Box(...)  win.add(vbox)  fig = pylab.figure()  canvas = FigureCanvas(fig)  toolbar = NavigationToolbar(canvas, fig)  axis = fig.add_axes(...)  vbox.pack_start(canvas,...)  vbox.pack_start(toolbar,....)  win.show_all()  while(Gtk.events_pending()): Gtk.main_iteration()   After this code I have a valid window on screen however it does not reacts on mouse clicks (zooming etc.) until calling Gtk.main_iteration() in loop or Gtk.main(). I can understand why, however it was working differently with old matplotlib and gtk2 (window was responsive all time).   The rest of my code is a python "Text User Interface" application (controlled by commands typed to terminal), the window is only for showing the results (animated waveform). Now I would like to keep the application as it is, but also to have responsive matplotlib window, without calling Gtk.main(). Is it possible? If yes, then how to do this?   Sorry for the long mail - I have no idea how to describe the problem shortly and all examples I found always have Gtk.main() called so they are in fact full GTK programs. I want a simple text program with matplotlib window as a "result showing" addition only.  Best Regards,  Michael Widlok
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180422/76175d36/attachment.html>


More information about the Matplotlib-users mailing list