Merge lp:~frank-niessink/squaremap/fix-for-taskcoach into lp:squaremap

Proposed by Frank Niessink
Status: Merged
Merged at revision: 49
Proposed branch: lp:~frank-niessink/squaremap/fix-for-taskcoach
Merge into: lp:squaremap
Diff against target: 11 lines (+1/-0)
1 file modified
squaremap/squaremap.py (+1/-0)
To merge this branch: bzr merge lp:~frank-niessink/squaremap/fix-for-taskcoach
Reviewer Review Type Date Requested Status
Mike C. Fletcher Pending
Review via email: mp+88373@code.launchpad.net

Description of the change

Hi Mike,

Without this one line patch I get errors in Task Coach. It seems the Squaremap code currently assumes that OnSize is always called at least once before OnPaint. If not, an AttributeError happens when trying to access the _buffer. I think it is safer to create a default _buffer in __init__ so this cannot happen at all.

Cheers, Frank

PS: This is not new, previous versions of Squaremap also had this issue. Until now I had only made the change in our copy of Squaremap without sending you the patch. If you accept this patch, we will have a pristine copy of Squaremap in our repository, yay.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'squaremap/squaremap.py'
2--- squaremap/squaremap.py 2012-01-08 05:32:53 +0000
3+++ squaremap/squaremap.py 2012-01-12 13:44:23 +0000
4@@ -120,6 +120,7 @@
5 self.highlight = highlight
6 self.selectedNode = None
7 self.highlightedNode = None
8+ self._buffer = wx.EmptyBitmap(20, 20) # Have a default buffer ready
9 self.Bind( wx.EVT_PAINT, self.OnPaint)
10 self.Bind( wx.EVT_SIZE, self.OnSize )
11 if highlight:

Subscribers

People subscribed via source and target branches