]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_core.py
Added licence line
[wxWidgets.git] / wxPython / src / gtk / _core.py
index 16ef5a06038e8c39e6d67494e9cb89e9162be56a..292e6c7ad9f7e59b07b450ffd7a6da8933487b19 100644 (file)
@@ -1520,6 +1520,12 @@ class InputStream(object):
         self.this = newobj.this
         self.thisown = 1
         del newobj.thisown
+    def __del__(self, destroy=_core_.delete_InputStream):
+        """__del__(self)"""
+        try:
+            if self.thisown: destroy(self)
+        except: pass
+
     def close(*args, **kwargs):
         """close(self)"""
         return _core_.InputStream_close(*args, **kwargs)
@@ -2125,6 +2131,20 @@ class Image(Object):
         """
         return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
 
+    def ConvertColourToAlpha(*args, **kwargs):
+        """
+        ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
+
+        This method converts an image where the original alpha information is
+        only available as a shades of a colour (actually shades of grey)
+        typically when you draw anti-aliased text into a bitmap. The DC
+        drawing routines draw grey values on the black background although
+        they actually mean to draw white with differnt alpha values.  This
+        method reverses it, assuming a black (!) background and white text.
+        The method will then fill up the whole image with the colour given.
+        """
+        return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
+
     def SetMaskFromImage(*args, **kwargs):
         """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
         return _core_.Image_SetMaskFromImage(*args, **kwargs)
@@ -5306,6 +5326,9 @@ your Mac."""
         if redirect:
             self.RedirectStdio(filename)
 
+        # Use Python's install prefix as the default  
+        wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
+
         # This finishes the initialization of wxWindows and then calls
         # the OnInit that should be present in the derived class
         self._BootstrapApp()
@@ -10791,7 +10814,6 @@ class _wxPyUnbornObject(object):
 
 
 #----------------------------------------------------------------------------
-_wxPyCallAfterId = None
 
 def CallAfter(callable, *args, **kw):
     """
@@ -10805,19 +10827,17 @@ def CallAfter(callable, *args, **kw):
     app = wx.GetApp()
     assert app is not None, 'No wx.App created yet'
 
-    global _wxPyCallAfterId
-    if _wxPyCallAfterId is None:
-        _wxPyCallAfterId = wx.NewEventType()
-        app.Connect(-1, -1, _wxPyCallAfterId,
-              lambda event: event.callable(*event.args, **event.kw) )
+    if not hasattr(app, "_CallAfterId"):
+        app._CallAfterId = wx.NewEventType()
+        app.Connect(-1, -1, app._CallAfterId,
+                    lambda event: event.callable(*event.args, **event.kw) )
     evt = wx.PyEvent()
-    evt.SetEventType(_wxPyCallAfterId)
+    evt.SetEventType(app._CallAfterId)
     evt.callable = callable
     evt.args = args
     evt.kw = kw
     wx.PostEvent(app, evt)
 
-
 #----------------------------------------------------------------------------