Fedora Core 2, PythonCard 0.8, wxPythonGTK-py2.3-2.5.2.8-FC2
I have a card with a background image (as an image rather than a background property).
I need to change the background image at run time.
Under PythonCardPrototype 0.7 (2?), this worked. Under PythonCard 0.8 the image insists on being at the frontmost layer - ie hiding any buttons, text fields etc on the page.
Cheers
Mike
Logged In: YES
user_id=228025
If you want to attach a zip with the relevant source, resource, and image
I'll take a look. You didn't say whether you are using GTK1 or GTK2 and
that could very well make a difference. If you are using an Image
component then the order that the components are created matters and
that behavior may have changed between wxPython 2.4.x and 2.5.x so I
would like to get more details since I don't run Linux myself. I especially
want to know if you are having general problems with overlapping
components.
Ah I just thought of another explanation. With PythonCard 0.8 I changed
Image to use GenStaticBitmap instead of StaticBitmap so that the
component would behave the same on all platforms. Look at PythonCard/
components/image.py. It might be that GenStaticBitmap - you can look
at the wxPython code in wx.lib.statbmp - draws itself such that overlaps
don't work as expected with StaticBitmap. That might be fixable, but I'm
not sure and will have to ask Robin.
On a related note you should be able to change the background image at
runtime. If you look at PythonCard/widget.py the relevant code is in the
Panel class. In your program if you did something like:
from PythonCard import graphic
self.panel._bitmap = graphic.Bitmap(filename)
that should change the background image. You may also need to refresh
and update to get it to change immediately rather than waiting for the
window to get "dirty" and redrawn.
self.panel.Refresh()
self.panel.Update()
ka