changing mousewatcher depending on position

here a example for the other way… without collisionrays

run.py

#dhochegger 2008
import direct.directbase.DirectStart
from direct.showbase import DirectObject

#display order

import background
import buttons
import 3Dview

run()

background.py

#dhochegger2008
import direct.directbase.DirectStart
from direct.showbase import DirectObject
from direct.gui.DirectGui import *

scale = .5
count = 4
class BACKGROUND (DirectObject.DirectObject):
    def __init__ (self):
            Xratio = float(scale / 3.0000+scale)            
            print "X->",Xratio

            background = DirectButton(image = "bckgrnd.tif",pressEffect = 0,pos = (.65,0,0), command = self.background,rolloverSound = "",clickSound = "", relief = None)
            background.setTransparency(1)    
            background.setScale(Xratio,0,.98)
            
            background1 = DirectButton(image = "bckgrnd.tif",pressEffect = 0,pos = (-.65,0,.48), command = self.background,rolloverSound = "",clickSound = "", relief = None)
            background1.setTransparency(1)    
            background1.setScale(Xratio,0,.5)           
                 
    def background (self):
        print "BACKGROUND.."

ba = BACKGROUND()

3Dview.py

#dhochegger 2008
import direct.directbase.DirectStart
from direct.showbase import DirectObject
left = 0
right = .5
bottom = 0
top = .5
class display (DirectObject.DirectObject):
    def __init__(self):

        base.setBackgroundColor(0, 0, 0)
        obj = loader.loadModel("cube")
        obj.reparentTo(render)
        obj.setPos(0,10,0)
        base.camNode.setActive(0)
        base.makeCamera(base.win, displayRegion = (left, right, bottom, top))
        
d = display()
run()

buttons.py

#dhochegger 2008
import direct.directbase.DirectStart
from direct.showbase import DirectObject
from direct.gui.DirectGui import *
from pandac.PandaModules import Point3,Vec3,Vec4
from direct.interval.LerpInterval import LerpFunc
from direct.interval.IntervalGlobal import * 
import sys
count = 4
class buttons (DirectObject.DirectObject):
    def __init__ (self):        
        XX = 0
        for x in range(count):
            XX += .15
            button = DirectButton(image = "button.tif", command = self.button, scale = (.2, .05, .05),rolloverSound = "", relief = None)
            button.setTransparency(1)    
            button.setPos(.65, 0,  -.1-XX)       
            X1=button.colorScaleInterval( .5,Vec4(1,1,1,1),Vec4(1,1,1,0) )
            X2=button.colorScaleInterval( 1.5,Vec4(1,1,1,0) )  
            Sequence( X1,Wait(.1),X2 ).loop()
    def button (self):
        print "happy button check check ;)"
b = buttons()