Index: direct/src/gui/DirectRadioButton.py =================================================================== RCS file: /cvsroot/panda3d/direct/src/gui/DirectRadioButton.py,v retrieving revision 1.3 diff -u -r1.3 DirectRadioButton.py --- direct/src/gui/DirectRadioButton.py 8 Jan 2009 21:45:14 -0000 1.3 +++ direct/src/gui/DirectRadioButton.py 15 Oct 2014 15:05:26 -0000 @@ -43,7 +43,7 @@ ('boxGeom', None, None), ('boxGeomColor', None, None), ('boxGeomScale', 1.0, None), - ('boxImage', loader.loadModel('models/gui/radio_button_gui'), None), + ('boxImage', None, None), ('boxImageScale', 1.0, None), ('boxImageColor', VBase4(1, 1, 1, 1), None), ('boxRelief', None, None), @@ -65,15 +65,23 @@ text = ('X', 'X'), relief = self['boxRelief'], ) + if not "boxRelief" in kw and self['boxImage'] is None: + self.indicator["relief"] = DGG.SUNKEN # Call option initialization functions self.initialiseoptions(DirectRadioButton) # After initialization with X giving it the correct size, put back space - if self['boxGeom'] == None: - self.indicator['text'] = (' ', '*') - self.indicator['text_pos'] = (0, -.5) - else: + # Note: If "boxImage" is set and is a sequence of at least two elements, we + # assume that it includes some indication of the button's state, and so + # blank the text-based indicator even if "boxGeom" is None + if self['boxGeom'] is not None or (hasattr(self['boxImage'], '__getitem__') and len(self['boxImage']) > 1): self.indicator['text'] = (' ', ' ') + else: + self.indicator['text'] = (' ', '*') + if self['boxImage'] is None: + self.indicator['text_pos'] = (0, -.25) + else: + self.indicator['text_pos'] = (0, -.5) if self['boxGeomColor'] != None and self['boxGeom'] != None: self.colors = [VBase4(1, 1, 1, 0), self['boxGeomColor']]