Commits

JanKanis committed 94a0886 Draft

add wxeventbinder.Frame

Comments (0)

Files changed (1)

-# -*- coding: utf-8 -*-
+# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: f; -*-
 #-------------------------------------------------------------------------------
 # Purpose:     Binding to wxPython events using a decorator.
 #
 
 
 initsubscribe = initbinder_factory(autosubscribe)
+
+
+class Frame (wx.Frame):
+  """wxeventbinder.Frame is a subclass of wx.Frame, that provides the methods autobind, autoappbind and autosubscribe that should be called to bind methods decorated with wxeventbinder.bind, .appbind and .subscribe. Usage of this class is an alternative to using the class decorators in this package or calling the module autobind functions directly."""
+
+  def autobind(self, handler=None, binder_id=STD_BINDER):
+    autobind(self, handler, binder_id)
+
+  def autoappbind(self):
+    self.autobind(wx.GetApp(), APP_BINDER)
+
+  def autosubscribe(self):
+    autosubscribe(self)
+