The above code I pasted was not correct. I pasted an older version. The sizer.Add() line should of been sizer.Add(self.nb) -- omit the (self). but I fixed the problem. I had to change that same line to sizer.add(self.nb, 1, wxEXPAND|wxALL)