Browse Source

gui: add simple way to enable overflow in DirectEntry

Closes #236
fireclawthefox 8 years ago
parent
commit
f2cf391a2e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      direct/src/gui/DirectEntry.py

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

@@ -59,6 +59,8 @@ class DirectEntry(DirectFrame):
             # Text used for the PGEntry text node
             # NOTE: This overrides the DirectFrame text option
             ('initialText',     '',               DGG.INITOPT),
+            # Enable or disable text overflow scrolling
+            ('overflow',        0,                self.setOverflowMode),
             # Command to be called on hitting Enter
             ('command',        None,              None),
             ('extraArgs',      [],                None),
@@ -159,6 +161,9 @@ class DirectEntry(DirectFrame):
     def setCursorKeysActive(self):
         PGEntry.setCursorKeysActive(self.guiItem, self['cursorKeys'])
 
+    def setOverflowMode(self):
+        PGEntry.set_overflow_mode(self.guiItem, self['overflow'])
+
     def setObscureMode(self):
         PGEntry.setObscureMode(self.guiItem, self['obscured'])