def __init__(self, upImageText=None, downImageText=None, listener=None,
                       **kwargs):

        if not kwargs.has_key('StyleName'):
            kwargs['StyleName']=self.STYLENAME_DEFAULT
        if kwargs.has_key('Element'):
            # XXX FIXME: createFocusable is used for a reason...
            element = kwargs.pop('Element')
        else:
            element = Focus.createFocusable()
        ButtonBase.__init__(self, element, **kwargs)

        self.curFace      = None # The button's current face.
        self.curFaceElement = None # No "undefined" anymore
        self.up           = None # Face for up.
        self.down         = None # Face for down.
        self.downHovering = None # Face for downHover.
        self.upHovering   = None # Face for upHover.
        self.upDisabled   = None # Face for upDisabled.
        self.downDisabled = None # Face for downDisabled.
        self.isCapturing = False # If True, this widget is capturing with
                                 # the mouse held down.
        self.isFocusing  = False # If True, widget has focus with space down.
        self.allowClick  = False # Used to decide whether to allow clicks to
                                 # propagate up to the superclass or container
                                 # elements.

        self.setUpFace(self.createFace(None, "up", self.UP))
        #self.getUpFace().setText("Not initialized yet:)")
        #self.setCurrentFace(self.getUpFace())

        # Add a11y role "button"
        # XXX: TODO Accessibility

        # TODO: pyjslib.isinstance
        if downImageText is None and listener is None:
            listener = upImageText
            upImageText = None

        if upImageText and isinstance(upImageText, basestring):
           upText = upImageText
           upImage = None
        else:
           upImage = upImageText
           upText = None

        if downImageText and isinstance(downImageText, basestring):
           downText = downImageText
           downImage = None
        else:
           downImage = downImageText
           downText = None

        #self.getUpFace().setText("Just a test")
        if upImage is not None:
            self.getUpFace().setImage(upImage)
        if upText is not None:
            self.getUpFace().setText(upText)
        if downImage is not None:
            self.getDownFace().setImage(downImage)
        if downText is not None:
            self.getDownFace().setText(downText)

        # set the face DOWN
        #self.setCurrentFace(self.getDownFace())

        # set the face UP
        #self.setCurrentFace(self.getUpFace())

        self.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS
                        | Event.KEYEVENTS)
        if listener is not None:
            self.addClickListener(listener)
Constructor for CustomButton.
dataset/ETHPy150Open anandology/pyjamas/library/pyjamas/ui/CustomButton.py/CustomButton.__init__