def DoGetBestSize(self):
        """
        Overridden base class virtual. Determines the best size of the
        button based on the label and bezel size.
        """

        label = self.GetLabel()
        if not label:
            return wx.Size(32, 32)
        
        dc = wx.ClientDC(self)
        dc.SetFont(self.GetFont())
        retWidth, retHeight = dc.GetTextExtent(label)
        
        width = int(max(retWidth, retHeight) * 1.5)
        return wx.Size(width, width)

        Overridden base class virtual. Determines the best size of the
        button based on the label and bezel size.
        
recipes/Python/577951_wxPythDramatic_shaded_3D_buttons_that_look_like_/recipe-577951.py