does anybody knows why I can’t subclass a DirectButton?
here my code:
class midg_button(DirectButton):
def __init__(self, parent = None, **kw):
DirectButton.__init__(self, parent, **kw)
class ciccio(DirectObject):
def __init__(self):
DirectObject.__init__(self)
butt=midg_button(
pos=(0,0,0),
text=("OK", "click!", "rolling over","disabled"),
text_scale=.3,
text_fg=(0,.99,0,1),
scale=1,
relief=DGG.FLAT,
)
if __name__ == '__main__':
app=ciccio()
run()
with the above I can’t see the button but if I use the following the button shows correctly:
class ciccio(DirectObject):
def __init__(self):
DirectObject.__init__(self)
butt=DirectButton(
pos=(0,0,0),
text=("OK", "click!", "rolling over","disabled"),
text_scale=.3,
text_fg=(0,.99,0,1),
scale=1,
relief=DGG.FLAT,
)
if __name__ == '__main__':
app=ciccio()
run()
any clues there?