Browse Source

support obscured mode for passwords

David Rose 24 years ago
parent
commit
595918c6fe
1 changed files with 8 additions and 0 deletions
  1. 8 0
      direct/src/gui/DirectEntry.py

+ 8 - 0
direct/src/gui/DirectEntry.py

@@ -31,6 +31,7 @@ class DirectEntry(DirectFrame):
             ('numLines',        5,                self.setup),
             ('numLines',        5,                self.setup),
             ('focus',           0,                self.setFocus),
             ('focus',           0,                self.setFocus),
             ('cursorKeys',      0,                self.setCursorKeysActive),
             ('cursorKeys',      0,                self.setCursorKeysActive),
+            ('obscured',        0,                self.setObscureMode),
             ('backgroundFocus', 0,                self.setBackgroundFocus),
             ('backgroundFocus', 0,                self.setBackgroundFocus),
             # Text used for the PGEntry text node
             # Text used for the PGEntry text node
             # NOTE: This overrides the DirectFrame text option
             # NOTE: This overrides the DirectFrame text option
@@ -95,6 +96,13 @@ class DirectEntry(DirectFrame):
     def setCursorKeysActive(self):
     def setCursorKeysActive(self):
         PGEntry.setCursorKeysActive(self.guiItem, self['cursorKeys'])
         PGEntry.setCursorKeysActive(self.guiItem, self['cursorKeys'])
 
 
+    def setObscureMode(self):
+        # Temporary try..except to support old Pandas.
+        try:
+            PGEntry.setObscureMode(self.guiItem, self['obscured'])
+        except:
+            pass
+
     def setBackgroundFocus(self):
     def setBackgroundFocus(self):
         PGEntry.setBackgroundFocus(self.guiItem, self['backgroundFocus'])
         PGEntry.setBackgroundFocus(self.guiItem, self['backgroundFocus'])