Skip to content

Commit

Permalink
wxGUI/main_window: add and use custom SingleWindowAuiManager class (#…
Browse files Browse the repository at this point in the history
…3177)

* wxGUI/main_window: add and use custom SingleWindowAuiManager class

Which override base OnClose window close event handler method
to prevent prematurely uninitialize manager.

wxWidgets/Phoenix#2460

* Update the package documentation class list
  • Loading branch information
tmszi committed Sep 26, 2023
1 parent 12bc350 commit 60fb51f
Showing 1 changed file with 14 additions and 1 deletion.
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 @@ -84,6 +85,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 @@ -144,7 +157,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

0 comments on commit 60fb51f

Please sign in to comment.