| 217 | _application = None |
| 218 | |
| 219 | def show(self): |
| 220 | # show the figure window |
| 221 | self.window.show() |
| 222 | self.canvas.draw() |
| 223 | if mpl.rcParams["figure.raise_window"]: |
| 224 | meth_name = {3: "get_window", 4: "get_surface"}[self._gtk_ver] |
| 225 | if getattr(self.window, meth_name)(): |
| 226 | self.window.present() |
| 227 | else: |
| 228 | # If this is called by a callback early during init, |
| 229 | # self.window (a GtkWindow) may not have an associated |
| 230 | # low-level GdkWindow (on GTK3) or GdkSurface (on GTK4) yet, |
| 231 | # and present() would crash. |
| 232 | _api.warn_external("Cannot raise window yet to be setup") |
| 233 | |
| 234 | def full_screen_toggle(self): |
| 235 | is_fullscreen = { |