WindowXML Linking Buttons

I’m creating my own script and using a custom GUI. So I created two buttons inside a WindowXML file

Code:
<control type="button" id="2">
            <control type="button" id="2">
            <description>Channels button</description>
            <top>35</top>
            <left>-30</left>
            <width>300</width>
            <height>60</height>
            <texturenofocus>channelslabel.png</texturenofocus>
            <texturefocus>testchannellbhl1.png</texturefocus>
            <onup>2</onup>
            <ondown>2</ondown>
            <onleft>2</onleft>
            <onright>3</onright>
        </control>
        <control type="button" id="3">
            <description>Guide Label</description>
            <top>35</top>
            <left>160</left>
            <width>300</width>
            <height>60</height>
            <texturenofocus>guidelabel.png</texturenofocus>
            <texturefocus>guidelabel.png</texturefocus>
            <onup>3</onup>
            <ondown>3</ondown>
            <onleft>2</onleft>
            <onright>3</onright>
        </control>

From what I read from Kodi wiki, onup, ondown, onleft, onright allows you to add an id to another control. So for example There is a channel button on the left and on the right there is a Guide button. Naturally, if you press the left arrow key or right arrow key, it should switch focus between the channel button and guide button. However, how does one apply this connection in python?

Code:
ACTION_NAV_BACK = 92
ACTION_LEFT  = 1
ACTION_RIGHT = 2
ACTION_UP    = 3
ACTION_DOWN  = 4

class mainGUI(xbmcgui.WindowXML):

    def onInit(self):
        self.setFocusId(2)

    def onAction(self, action):

        if action == ACTION_NAV_BACK:
            self.close()

    def onClick(self, controlID):
        pass

    def onFocus(self, controlID):
        pass

The keys Action_Left and Action_Right apply to the left and right arrow keys. I know I’m suppose to check whether the left or right arrow keys were pressed but I’m confused how to make these buttons follow the onup ondown onleft onright parameters using python code. Any help?