Ok, that may be why the code I supplied works on my systems but not yours, we're using different versions of wxPython. At the moment I do not have a system with wx 2.8 installed, however I do not mind setting up a virtual machine when I get home if nobody else here is using the same version.
On Thursday, April 24, 2014 10:39:24 AM UTC-4, Eric wrote:
Hi Mike,
I work on python 2.7.3 with wx 2.8.12.1 on an Ubuntu 12.04 machine.
Eric
Le Mercredi 23 avril 2014 16h29, Mike Stover <hakug...@gmail.com > <javascript:>> a écrit :
What versions of Python and wxPython are you using? The code
worked for me with Python 2.7.5 and wxPython 2.9.5.0 on Win7 32bit
as well as Python 2.7.5, wxPython 3.0.0.0 on Ubuntu 12.04. I was
also using a random jpg image I found via Google as the original
image I attempted to use was too large.
On Wednesday, April 23, 2014 10:22:36 AM UTC-4, Eric wrote:
Hi Mike,
thanks a lot for your help.
Unfortunately, running your updated version of the snippet
still did not showed any bitmap in the panel. In the meantime,
I could find a way to make it out. This was done by replacing:
self.Bind(wx.EVT_ERASE_
BACKGROUND, self.OnEraseBackground)
by:
self.Bind(wxaui.EVT_AUI_ RENDER, self.OnEraseBackground)
You will find this in the new version of the test enclosed. I
relocated the aui manager in its original place as, in the
whole application, it is used to dock some pane inside a given
page of the notebook.
The problem with this approach is that the event handler is
called several times with very huge values of the dc.GetSize()
and I do not understand why and what is exactly going on.
Would you have any
idea about this ?
thanks
Eric
On Wednesday, April 23, 2014 3:16:54 PM UTC+2, Mike Stover wrote:
Greeting Eric,
I have attached an updated version of your code using some
samples from various sources (including Mouse vs Python
<http://blog.pythonlibrary.org/>\). If you are using
wxPython 2.9.x it has been found that BG_STYLE_CUSTOM
causes issues, so that is commented out. I've also did a
little bit of tidying up on your original code. You may
notice that AuiManager and AuiNotebook are being
subclassed, in my opinion this will make it easier to
"customize / tweak" later. I also set AuiManager to manage
the notebook, this was not present in the original code. I
may be wrong, but it appeared that you were setting up
AuiManager, but not using it.
Hopefully someone with more wxPython knowledge can help
explain anything I may have missed or didn't explain
correctly.
- Mike S
On Wednesday, April 23, 2014 6:07:41 AM UTC-4, Eric wrote:
Dear wxpython users,
I have an application that contains an aui notebook.
Each page of this notebook hosts a panel that should
be managed by an aui manager.
When I try to set a background image to this panel the
image is not displayed and the event
wx.EVT_ERASE_BACKGROUND is event not
fired. You will find attached a snippet that
reproduces this (unwanted) behaviour.
Would you have any idea about what is wrong with my
code and how I can solve this ?
thanks a lot
Eric
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com <mailto:wxpython-users+unsubscribe@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.