Check Box code is wrong but why?

I define some check boxes

self.cbH = wx.CheckBox(pnl, -1, " Hamburger", (xPos, yPos), (150, 20))
self.cbB = wx.CheckBox(pnl, -1, “Bacon”, (xPos, yPos + 20), (150, 20))
self.cbM = wx.CheckBox(pnl, -1, “Mushroom”, (xPos, yPos + 40), (150, 20))

Then in a button event I try to display a message based on a checkBox state

   def onButton(self, event):
    if cbH.checked:        #  this makes sense to me seems wrong?     
        msg = "Hamburger"        
        wx.MessageBox(msg, 'Check Boxes',            
              wx.OK | wx.ICON_INFORMATION

Not sure how to change the cbH.checked if statement

TIA
Bob

Since you save the reference as an attribute of self then you need to access it the same way. So something like this:

    def onButton(self, event):
        if self.cbH.IsChecked():
            msg = "Hamburger"        
            wx.MessageBox(msg, 'Check Boxes',            
                  wx.OK | wx.ICON_INFORMATION