Anyone ever have problems with BitmapButtons where they work on
GTK/Linux but are completely unresponsive on MSW? On MSW, it's not
just that the button doesn't fire off an event, it doesn't even depress
when clicked on!
It's inside a sizer and a panel that is ultimately in a notebook inside
a splitter. Other controls in the sizer&panel work just fine. I create
the button with:
button = wx.BitmapButton(self, -1, aBitmap)
Otherwise you need more bitmaps for the disabled, focus,
and selected states. Note that the docs say that
the wxBU_AUTODRAW style is needed on win32
only - which explains why it worked on GTK I guess.
Anyone ever have problems with BitmapButtons where they work on
GTK/Linux but are completely unresponsive on MSW? On MSW, it's not
just that the button doesn't fire off an event, it doesn't even depress
when clicked on!
It's inside a sizer and a panel that is ultimately in a notebook inside
a splitter. Other controls in the sizer&panel work just fine. I create
the button with:
button = wx.BitmapButton(self, -1, aBitmap)
Sure, but that's already the default value for the constructor! I added
it anyway just in case the docs were wrong, but there was no change in
behavior.
Thanks for trying,
···
On Friday 02 May 2003 09:38 am, Jeff Sasmor wrote:
If you're only using ONE bit map for all states
(normal, disabled, etc) then you need to use the
wxBU_AUTODRAW style so for your example
you'd have:
Well, I guess you're right. I'd forgotten that. But I checked in
some of my own code and it does work for me in that the button
shows depressed state, etc. And of course the wxBU_AUTODRAW
wasn't in that code either...
Win2k, Python 2.2.2, wxPy 2.3.4.2
I haven't tried 2.4.x yet as you seem to from 'wx2407'.
···
#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message -----
From: "Chuck Esterbrook" <ChuckEsterbrook@yahoo.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, May 02, 2003 12:57 PM
Subject: Re: [wxPython-users] wxBitmapButton problem
On Friday 02 May 2003 09:38 am, Jeff Sasmor wrote:
If you're only using ONE bit map for all states
(normal, disabled, etc) then you need to use the
wxBU_AUTODRAW style so for your example
you'd have:
Sure, but that's already the default value for the constructor! I added
it anyway just in case the docs were wrong, but there was no change in
behavior.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Anyone ever have problems with BitmapButtons where they work on GTK/Linux but are completely unresponsive on MSW? On MSW, it's not just that the button doesn't fire off an event, it doesn't even depress when clicked on!
It's inside a sizer and a panel that is ultimately in a notebook inside a splitter. Other controls in the sizer&panel work just fine. I create the button with:
button = wx.BitmapButton(self, -1, aBitmap)
wx2407, Py 2222, Win2k
Any ideas?
On Windows this can sometimes happen if there is a mistake in the parentage of one or more of the windows. In that case the Z-order does not always match the visual appearance so when you click on the button WIndows actually sends the click to some other window... To check this try making a small test app with just a frame, panel and a wxBitmapButton.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Thanks, that was it! I just went straight back to my code and double
checked the parenting.
Question: Would it be appropriate in wxWindow::SetSizer() to verify that
the parent of each of the windows in the sizer "is self"?
This would have caught my bug at the source and if it's really suppose
to always be the case, then it seems like a good assertion.
Also I think the method would descend into sizers within the sizer, but
not windows.
Make sense or am I missing something?
···
On Friday 02 May 2003 10:29 am, Robin Dunn wrote:
Chuck Esterbrook wrote:
> Anyone ever have problems with BitmapButtons where they work on
> GTK/Linux but are completely unresponsive on MSW? On MSW, it's not
> just that the button doesn't fire off an event, it doesn't even
> depress when clicked on!
>
> It's inside a sizer and a panel that is ultimately in a notebook
> inside a splitter. Other controls in the sizer&panel work just
> fine. I create the button with:
> button = wx.BitmapButton(self, -1, aBitmap)
>
> wx2407, Py 2222, Win2k
>
> Any ideas?
On Windows this can sometimes happen if there is a mistake in the
parentage of one or more of the windows. In that case the Z-order
does not always match the visual appearance so when you click on the
button WIndows actually sends the click to some other window... To
check this try making a small test app with just a frame, panel and a
wxBitmapButton.
Chuck Esterbrook wrote:
> Thanks, that was it! I just went straight back to my code and
> double checked the parenting.
>
> Question: Would it be appropriate in wxWindow::SetSizer() to verify
> that the parent of each of the windows in the sizer "is self"?
>
> This would have caught my bug at the source and if it's really
> suppose to always be the case, then it seems like a good assertion.
>
> Also I think the method would descend into sizers within the sizer,
> but not windows.
>
> Make sense or am I missing something?
Sounds like a good idea. My guess is that a patch to do this would
be applied. (hint, hint)