Skip to content

Commit

Permalink
FIX : Handle the events correctly (#915)
Browse files Browse the repository at this point in the history
This was missed in the `on_trait_change` to `observe` changes
introduced in #880 . The methods were previously receiving
`obj` as an argument to the trait change handler which should
have been replaced with `event.object` in #880.
  • Loading branch information
Poruri Sai Rahul authored Mar 26, 2021
1 parent 2dae9b4 commit aef3b51
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pyface/ui/wx/action/tool_bar_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ def __init__(self, tool_bar_manager, parent, id, style):
def _on_tool_bar_manager_enabled_changed(self, event):
""" Dynamic trait change handler. """

obj.window._wx_enable_tool_bar(self, event.new)
event.object.window._wx_enable_tool_bar(self, event.new)

def _on_tool_bar_manager_visible_changed(self, event):
""" Dynamic trait change handler. """

obj.window._wx_show_tool_bar(self, event.new)
event.object.window._wx_show_tool_bar(self, event.new)


class _AuiToolBar(AUI.AuiToolBar):
Expand Down Expand Up @@ -409,7 +409,9 @@ def _on_tool_bar_manager_enabled_changed(self, event):
""" Dynamic trait change handler. """

try:
obj.controller.task.window._wx_enable_tool_bar(self, event.new)
event.object.controller.task.window._wx_enable_tool_bar(
self, event.new
)
except:

pass
Expand All @@ -418,7 +420,9 @@ def _on_tool_bar_manager_visible_changed(self, event):
""" Dynamic trait change handler. """

try:
obj.controller.task.window._wx_show_tool_bar(self, event.new)
event.object.controller.task.window._wx_show_tool_bar(
self, event.new
)
except:

pass
Expand Down

0 comments on commit aef3b51

Please sign in to comment.