Skip to content

Commit

Permalink
WxWgpuWindow object has no attribute 'add_event_handler' (#486)
Browse files Browse the repository at this point in the history
* fixed request draw timer wait time for wx backend #485

* removed inexistent add_event_handler call in wx backend #485

* added .idea to gitingore for pycharm developers

* removed unused weakbind import
  • Loading branch information
cansik committed Mar 29, 2024
1 parent 840efcf commit 501ac82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,5 @@ venv.bak/
# mypy
.mypy_cache/

# jetbrains idea
.idea/
5 changes: 2 additions & 3 deletions wgpu/gui/wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ctypes

from .base import WgpuCanvasBase
from ._gui_utils import get_alt_x11_display, get_alt_wayland_display, weakbind
from ._gui_utils import get_alt_x11_display, get_alt_wayland_display

import wx

Expand Down Expand Up @@ -121,7 +121,7 @@ def _request_draw(self):
# that drawing only happens when the mouse is down, see #209.
if not self._request_draw_timer.IsRunning():
self._request_draw_timer.Start(
self._get_draw_wait_time() * 1000, wx.TIMER_ONE_SHOT
max(1, int(self._get_draw_wait_time() * 1000)), wx.TIMER_ONE_SHOT
)

def close(self):
Expand All @@ -143,7 +143,6 @@ def __init__(self, *, parent=None, size=None, title=None, max_fps=30, **kwargs):
self.SetTitle(title or "wx wgpu canvas")

self._subwidget = WxWgpuWindow(parent=self, max_fps=max_fps)
self._subwidget.add_event_handler(weakbind(self.handle_event), "*")
self.Bind(wx.EVT_CLOSE, lambda e: self.Destroy())

self.Show()
Expand Down

0 comments on commit 501ac82

Please sign in to comment.