From f2cf391a2e87870a5abf7f8369f8e01e44c73dfe Mon Sep 17 00:00:00 2001 From: fireclawthefox Date: Wed, 24 Jan 2018 19:00:34 +0100 Subject: [PATCH] gui: add simple way to enable overflow in DirectEntry Closes #236 --- direct/src/gui/DirectEntry.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/direct/src/gui/DirectEntry.py b/direct/src/gui/DirectEntry.py index 2eb7607400..6955e550a2 100644 --- a/direct/src/gui/DirectEntry.py +++ b/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'])