Thanks Robin,
you have right, wxPanel.SetDefaultItem() accepts wxWindow instance.
I've made the following changes in button.py, but when I hit ENTER
happens nothing. DeafultItem has set and point to the wxGenBitmapButton
instance.
What happens in the wxWindows event system when user
hits ENTER in a wxPanel that has a default button? Need I implement any
other event handler in wxGenBitmapButton to receive the ENTER key?
# file: wxPython/lib/buttons.py
...
def SetDefault(self):
if self.GetParent():
self.GetParent().SetDefaultItem(self)
...
I've browsed the wxWindows source to see how SetDefault() is in normal
wxButton implemented, but SetDefault() is "made by" the underliying windowing
system.(MSW or GTK)
# in GTK:
void wxBitmapButton::SetDefault()
{
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
gtk_widget_grab_default( m_widget );
SetSize( m_x, m_y, m_width, m_height );
}
TIA,
Attila Szuts