Button Scripting problem

Hey all - I have these (checkboxes) that i modeled inside of Maya, and the directcheckbutton just wasn’t quite enough so i am trying to do it with directbuttons.

Simple enough, right? Well i am getting a funny symptom whenever i alter the state of the button, the first time i alter the state it just goes invisible, then when i alter the state again it comes back BUT its upside down. I tried going into statenodepath and setting the HPRs but it made no difference.

Heres the codes:

 self.checkButtonOne = DirectButton(geom = (self.check.find('**/checkon'),
                                                   self.check.find('**/checkoff'),
                                                   self.check.find('**/checkoff'),
                                                   self.check.find('**/checkoff')),
                                           pos = (1.1, 0, -.39),
                                           clickSound = None,
                                           rolloverSound = None,
                                           scale = .03,
                                           relief = None,
                                           command = self.easyPressed)

Then inside of easyPressed:

self.checkButtonOne['geom'] = (self.check.find('**/checkoff'),
                                           self.check.find('**/checkon'),
                                           self.check.find('**/checkon'),
                                           self.check.find('**/checkoff') 

Thanks for your help guys.

Hmm, sounds like a bug. But maybe instead of trying to change the geom of your DirectButton, you can just have two different DirectButtons with different geoms, and hide one and show the other?

David

Maybe try pg button?

panda3d.org/apiref.php?page=PGButton

PG-stuff appear to work much better (or maybe i just hope so) any ways i have just tested

        style = PGFrameStyle()
        style.setType(PGFrameStyle.TNone)
        self.entry.setFrameStyle(0,style)
        self.entry.setFrameStyle(1,style)

for pgentry it probably works for pgbutton too because that’s same code.

The PGui stuff is just the low-level C++ implementation that’s used by DirectGui.

David