[wxPython-users] undocumented wx.PyWindow class?

Christopher Barker Chris.Barker at noaa.gov
Fri Dec 15 14:40:07 PST 2006


Edward, nice to have you back -- I hope wx works out well for you.

> The wx.PyWindow class appears in the demo code in several places where one
> would expect a wx.Panel.  I have not found any documentation for this.  
> Does any exist?

Try here:
http://wxpython.wxcommunity.com/docs/api/wx.PyWindow-class.html

These are python-specific docs that are auto-generated -- the 
explanation of stuff is not really that complete, but it should have all 
the classes in it at least.

> On XP (and maybe other platforms), wx.TreeCtrl clips one pixel from 
> icons in the image list.  The following hack is my workaround:

don't know why, but:

> imageList = wx.ImageList(21,11)
> bitmap = wx.Bitmap(fileName,type=wx.BITMAP_TYPE_BMP) # A 20x10 bitmap
> image = wx.ImageFromBitmap(bitmap)
> image.Resize(size=(21,11),pos=(0,0),) # Add one pixel to the height & width
> bitmap = wx.BitmapFromImage(image)
> imageList.Add(bitmap)

here you are taking your original image and stretching it. I suspect 
you'd rather just add the extra pixels that then won't get displayed. 
You should be able to do that something like this (not tested):

oldbitmap = wx.Bitmap(fileName,type=wx.BITMAP_TYPE_BMP) # A 20x10 bitmap
bitmap = wx.EmptyBitmap((21,11))
dc = wx.MemoryDc()
dc.SelectObject(bitmap)
dc.DrawBitmap(0,0,oldbitmap)
imageList.Add(newbitmap)


-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception




More information about the wxpython-users mailing list