Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
72d8c6da
Commit
72d8c6da
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug w.r.t. user grouping control panels into a tabbed notebook.
parent
13de8170
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/fsleyes/views/viewpanel.py
+41
-23
41 additions, 23 deletions
fsl/fsleyes/views/viewpanel.py
with
41 additions
and
23 deletions
fsl/fsleyes/views/viewpanel.py
+
41
−
23
View file @
72d8c6da
...
@@ -557,31 +557,49 @@ class ViewPanel(fslpanel.FSLEyesPanel):
...
@@ -557,31 +557,49 @@ class ViewPanel(fslpanel.FSLEyesPanel):
ev
.
Skip
()
ev
.
Skip
()
panel
=
ev
.
GetPane
().
window
panel
=
ev
.
GetPane
().
window
if
isinstance
(
panel
,
(
fslpanel
.
FSLEyesPanel
,
# If the user has grouped multiple control panels
fsltoolbar
.
FSLEyesToolBar
)):
# into a single tabbed notebook, and then closed
# the entire notebook, the AuiManager will generate
panel
=
self
.
__panels
.
pop
(
type
(
panel
),
None
)
# a single close event, and will pass us that
# notebook. So we have to look in the notebook
# WTF AUI. Sometimes this method gets called
# to see which control panels were actually closed.
# twice for a panel, the second time with a
if
isinstance
(
panel
,
wx
.
lib
.
agw
.
aui
.
AuiNotebook
):
# reference to a wx._wxpyDeadObject; in such
panels
=
[
panel
.
GetPage
(
i
)
for
i
in
range
(
panel
.
GetPageCount
())]
# situations, the Destroy method call below
else
:
# will result in an exception being raised.
panels
=
[
panel
]
if
panel
is
not
None
:
log
.
debug
(
'
Panel closed: {}
'
.
format
(
type
(
panel
).
__name__
))
for
panel
in
list
(
panels
):
if
isinstance
(
panel
,
(
fslpanel
.
FSLEyesPanel
,
fsltoolbar
.
FSLEyesToolBar
)):
# WTF AUI. Sometimes this method gets called
# twice for a panel, the second time with a
# reference to a wx._wxpyDeadObject; in such
# situations, the Destroy method call below
# would result in an exception being raised.
if
self
.
__panels
.
pop
(
type
(
panel
),
None
)
is
None
:
panels
.
remove
(
panel
)
# calling fslpanel.FSLEyesPanel.destroy()
# calling fslpanel.FSLEyesPanel.destroy()
# here - wx.Destroy is done below
# here - wx.Destroy is done below
panel
.
destroy
()
else
:
log
.
debug
(
'
Panel closed: {}
'
.
format
(
type
(
panel
).
__name__
))
# Even when the user closes a pane,
panel
.
destroy
()
# AUI does not detach said pane -
# we have to do it manually
# Destroy all the panels
self
.
__auiMgr
.
DetachPane
(
panel
)
for
panel
in
panels
:
self
.
__auiMgrUpdate
()
# Even when the user closes a pane,
panel
.
Destroy
()
# AUI does not detach said pane -
# we have to do it manually
self
.
__auiMgr
.
DetachPane
(
panel
)
wx
.
CallAfter
(
panel
.
Destroy
)
# Update the view panel layout
wx
.
CallAfter
(
self
.
__auiMgrUpdate
)
#
#
# Here I am monkey patching the
# Here I am monkey patching the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment