I now have the new markup bar buttons up and rendering correctly, complete with rollover. However, when I click on any of the buttons, the app crashes. It looks like the wxPython class wx.lib.buttons.GenBitmapButton cannot handle “self”’s C++ class being deleted in the middle of OnLeftUp().
Here are some pictures (you can also just
view the Flickr set):

My very first successful rendering of buttons.
Up until this point I was having a lot of problems with Python’s handling of
__init() methods and their parameters.
Specifically, keyword parameters vs positional ones vs default-value parameters
(are they keywords? Are they positional? I think the answer to both questions is “yes”!).
As you can see, the buttons are way too big. But still, I wanted to try a rollover to see if it worked…

Rollover works!
.. and it id!
Nice.
I fixed the size problem and also the read-only icon to be the right bitmap, and got this:

Now that looks more like it!
Note the button background is all white.
That might be a symptom of using
ContainerBlocks.BoxContainer
as the parent block for the buttons.
I had to try rolling over the buttons (I already knew clicking would cause a crash),
so here are the other buttons rolled over one-by-one..

rolling over contact

rolling over task

rolling over event

rolling over private
So what happens when you click?
First all the buttons disappear, which I assume is a normal part of switching how things look:

What happens when you click
Then the app crashes with this stack trace:
Traceback (most recent call last):
File “/Users/rae/work/osaf/chandler/chandler/release/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wx/lib/buttons.py”, line 315, in OnLeftUp
self.Refresh()
File “/Users/rae/work/osaf/chandler/chandler/release/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wx/_core.py”, line 12815, in __getattr__
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the wxChandlerMultiStateButton object has been deleted, attribute access no longer allowed.
release/RunChandler: line 13: 1838 Bus error $CHANDLERBIN/release/RunPython -O $CHANDLERHOME/Chandler.py “$@”
The code in buttons.py”, line 315 looks like this:
def OnLeftUp(self, event):
if not self.IsEnabled() or not self.HasCapture():
return
if self.HasCapture():
self.ReleaseMouse()
# if the button was down when the mouse was released…
if not self.up:
self.Notify()
self.up = True
self.Refresh()
event.Skip()
the crash happens in the second-last line.
The C++ button is gone, so it cannot refresh.
So.. on with the show!