Button Command

All I want the Button to do when it’s clicked is to change the text color to white and make the alpha of the text to half. But it’s not working!

oh and also can anyone help me with changing my button’s pos to the top right corner? if you can that would be great!!!

import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import *

from pandac.PandaModules import TextNode


bk_text = "experimenting with Direct GUIs"
textObject = OnscreenText(text = bk_text, pos = (0.95,-0.95), 
scale = 0.07,fg=(1,0.5,0.5,1),align=TextNode.ACenter,mayChange=1)


def setText():
        bk_text = "Button Clicked"
        textObject.setText(bk_text)
        


 


maps = loader.loadModel('button_maps.egg')
b = DirectButton(relief = None, text_pos= ( .9, -0.015),text_fg= (0,0,0,1),
  
  text = ("Campaign", "Campaign", "Campaign", "Campaign"),scale=0.8,command=(setText,text_fg= (1,1,1,1)),text_scale= (.15,.08),
  geom_pos = ( .9,-5,0),
  geom = (maps.find('**/button_up'),
                         maps.find('**/button_down'),
                         maps.find('**/button_up'),
                         maps.find('**/button_dis')))                       


                         


run()
self.butEgg = loader.loadModel("button")
self.but = DirectButton(scale = 0.525, pos = (-0.0335, 0, 0.285), relief = None, rolloverSound = None, command = self.butEvent, text_fg = (1, 0, 0, 1),
                                geom = (self.butEgg.find("**/button_def"), self.butEgg.find("**/button_glow"), self.butEgg.find("**/button_glow"), self.butEgg.find("**/button_def")))
self.but.setTransparency(1)
self.but.setColor(0.9,0.95,0.7,1)

def butEffect(self):
     self.but["text"] = "text change"
     self.but["text_fg"] = (1, 1, 1, 0.5)

The pos is done the same way.
Read up on Text in the manual to see how you can have the font change it’s color, style etc.
Hope this helps.