Skip to content
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

wxGUI/main_window: add and use custom SingleWindowAuiManager class #3177

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion gui/wxpython/main_window/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Classes:
- frame::GMFrame
- frame::SingleWindowAuiManager

(C) 2006-2021 by the GRASS Development Team

Expand Down Expand Up @@ -90,6 +91,18 @@
from grass.grassdb.checks import is_first_time_user


class SingleWindowAuiManager(aui.AuiManager):
"""Custom AuiManager class which override OnClose window
close event handler method to prevent prematurely uninitialize
manager

https://github.com/wxWidgets/Phoenix/pull/2460
"""

def OnClose(self, event):
event.Skip()


class GMFrame(wx.Frame):
"""Single Window Layout which will be parallelly developed next to the
current Multi Window layout solution."""
Expand Down Expand Up @@ -150,7 +163,7 @@ def show_menu_errors(messages):
self._menuTreeBuilder = LayerManagerMenuData(message_handler=add_menu_error)
# the search tree and command console
self._moduleTreeBuilder = LayerManagerModuleTree(message_handler=add_menu_error)
self._auimgr = aui.AuiManager(self)
self._auimgr = SingleWindowAuiManager(self)

# list of open dialogs
self.dialogs = dict()
Expand Down