Hi,
For the record here's why my code didn't work; in case anyone is as
obtuse as I was!.
Robin, your code works for me as well, and after examination I'd missed
self.diagram.AddShape(shape)
Douhh! It must have been late. (well that's my excuse!)
I'm not too worried about text at the moment but I'll bear your
flushtext in mind Kevin, cheers.
Thanks for your help, I'm going back to RTFM.
Lee
BTW wxpython is great to use and the demo is an _excellent_ resource for
viewing capabilities and pilfering code - it lets you dive right in.
···
Fri, 23 Mar 2001 13:21:35 -0800
Previous message: [wxpython-users] OT: Looking for feebback on new wxPython/wxWindows app
Next message: [wxpython-users] Re: [wxPython] FW: Accessing Python stuff thru OLE...
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]My shape is always blank without text.
I've used the demo code in a seperate app and tried adding to 'shapes'list, adding independently to canvas.
I've tried loading bitmap through wxBitmap,wxImage,PIL and
wxBitmapShape.
I've tried setting pens, brushes.
I'm now running out of ideas!After tweaking MyAddShape to optionally set the pen and brush, adding this
to the demo works for me:
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
s = wxBitmapShape()
s.SetBitmap(bmp)
self.MyAddShape(s, 225, 150, None, None, "Bitmap") The only problem is that the text shows up in the middle of the bitmap,
you'll probably have to do something with constraints or shape regions to
put it somewhere else. Has anybody done this already and want to share some
code? --
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!
--
wxPython