]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_image.i
Added some info panels that show size and colour attributes about the widget
[wxWidgets.git] / wxPython / src / _image.i
index cdf9ecebb862aecadae80195fc8fca3328cc59f4..08d530f0eb539bf92b0931aeb0db98d5c74ec491 100644 (file)
@@ -161,6 +161,13 @@ public:
     int GetWidth();
     int GetHeight();
 
+    %extend {
+        wxSize GetSize() {
+            wxSize size(self->GetWidth(), self->GetHeight());
+            return size;
+        }
+    }
+
     wxImage GetSubImage(const wxRect& rect);
     wxImage Copy();
     void Paste( const wxImage &image, int x, int y );
@@ -204,7 +211,7 @@ public:
             unsigned char* buffer;
             int size;
 
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             if (!PyArg_Parse(data, "t#", &buffer, &size))
                 goto done;
 
@@ -214,7 +221,7 @@ public:
             }
             self->SetData(buffer);
         done:
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
         }
 
 
@@ -258,7 +265,7 @@ public:
             unsigned char* buffer;
             int size;
 
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             if (!PyArg_Parse(data, "t#", &buffer, &size))
                 goto done;
 
@@ -268,7 +275,7 @@ public:
             }
             self->SetAlpha(buffer);
         done:
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
         }
     }