ah, i see. thx!
I changed my list creation code by adding another Arg to the button command like this:
z = DirectButton(text = f, text_scale = 0.05, text_align =TextNode.ALeft,
text_font=self.GAME_FONT, text_pos=(-.4,.7,0), relief = None,
text0_fg=(0,0,1,1), text1_fg=(1,0,0,1), text2_fg=(1,1,0,1), text3_fg=(0,1,1,1),
text0_bg=(0,0,0,1),text2_bg=(0,0,0,1), command=self.screenCharEdit1, extraArgs=[f, self])
I added the 2nd arg to screenCharEdit1 like this:
def screenCharEdit1(self, charfile, lastButton): # This screen pops up when character selected in list
self.lastButton = lastButton
and finally, I used it in my delete button command like this:
self.lstChar.removeItem(self.lastButton,refresh=1)
no crashes, but the button doesn’t do anything. I printed what lastButton was and realized it’s the game object? (oops)
<__main__.MyGame instance at 0x03272238>
so what should the 2nd argument when i create the button be? I can’t use z