I've been trying to get better integration with the generic buttons in
wx.lib.buttons and the default button behavior, and I've about had to
give it up as a lost cause.
The MSW default item code is complicated. Much of it can be simulated
from wxPython, but notifying the other default items relies on wxMSW
specific methods that aren't exposed from wxPython (and might be
private in general). I'm not sure exactly what's necessary for the
other platforms. wxGtk uses a gtk call that might only work for
buttons.
More importantly, the default item behavior in wxDialog is inherently
tied to wxButton and won't work for anything else, period - there's a
wxDynamicCast to wxButton.
There's also no way to do "owner drawn" wxButtons, and the entire
concept of "owner draw" is mostly windows only and I'm not sure what
kind of API would be preferable on other platforms.
I don't really know what the best option is is:
Just document wx.lib.buttons as not working as default items, remove
the SetDefault method and call it a day.
Expose some sort of owner-draw API for wxButton. Maybe have a
wxButtonPaint event that extends wxPaintEvent to give access to some
of the owner draw information.
Have the default item selection in wxDialog use wxControl, not
wxButton (so any item can be a default item), re-implement all the
default item handling that's in wxButton in python (I've done this
already, hopefully it'll work for non-windows platforms) and then
either live with the graphical inconsistency of 2 default buttons, or
expose wxButton::SetDefaultStyle from wxPython.
If I can take a quick straw poll, how many people are using generic
buttons in dialogs and could benefit from correct default item
behavior?