]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/misc.i
Did splitting of wxEntry for wxMSW. Not nearly as complex as wxGTK
[wxWidgets.git] / utils / wxPython / src / misc.i
index a9834bec4691d2960f605047222a0e279bcec8b1..482871611a5ba0fc3b2ecf6cc07bede0adabb9a4 100644 (file)
@@ -156,6 +156,45 @@ public:
     }
     %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
     %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
+    %pragma(python) addtoclass = "
+    # override the __getattr__ made by SWIG
+    def __getattr__(self, name):
+        d = {
+            'x' : miscc.wxRect_x_get,
+            'y' : miscc.wxRect_y_get,
+            'width' : miscc.wxRect_width_get,
+            'height' : miscc.wxRect_height_get,
+            'top' : miscc.wxRect_GetTop,
+            'bottom' : miscc.wxRect_GetBottom,
+            'left' : miscc.wxRect_GetLeft,
+            'right' : miscc.wxRect_GetRight,
+            }
+        try:
+            func = d[name]
+        except KeyError:
+            raise AttributeError,name
+        return func(self)
+
+    # and also the __setattr__
+    def __setattr__(self, name, value):
+        d = {
+            'x' : miscc.wxRect_x_set,
+            'y' : miscc.wxRect_y_set,
+            'width' : miscc.wxRect_width_set,
+            'height' : miscc.wxRect_height_set,
+            'top' : miscc.wxRect_SetTop,
+            'bottom' : miscc.wxRect_SetBottom,
+            'left' : miscc.wxRect_SetLeft,
+            'right' : miscc.wxRect_SetRight,
+            }
+        try:
+            func = d[name]
+        except KeyError:
+            self.__dict__[name] = value
+            return
+        func(self, value)
+    "
+
 };
 
 
@@ -383,7 +422,7 @@ public:
 class wxAcceleratorTable {
 public:
     // Can also accept a list of 3-tuples
-    wxAcceleratorTable(int LCOUNT, wxAcceleratorEntry* LIST);
+    wxAcceleratorTable(int LCOUNT, wxAcceleratorEntry* choices);
     ~wxAcceleratorTable();
 
 };