Help building DirectEntry that is really big?

Hi, I plan to impliment a sort of “Leave a message for someone” feature in my game, that way you can basically write someone an entire letter, now the problem is building a gui for this… I really need help getting this code to be nicer, I dunno much about how to do this though as it seems as though it’s really low-level DirectEntry stuff.

The goal is to build a big entry area, such as the one when you type an email to someone via gmail, or similar to the one I am typing this post in right now. Only the input box that lets you type multiple lines of text, use the arrows up and down to navigate up rows of text (is that even plausible with DirectEntry?), and using enter to skip to a new line (I have big problems with this one)

Here is what I’ve been able to build up so far:

import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText 
from direct.gui.DirectGui import *
from pandac.PandaModules import *

def setText(text):
	b.enterText(text + '\n')
	b.setCursorPosition(1000000)
	b['focus'] = True
 
b = DirectEntry(
				width = 30,
				command = setText,
				scale=.05,
			#	initialText = "Type Something",
				numLines = 8,
				focus=1,
				pos = (-1, 0, 0)
				)
b.setCursorKeysActive()
run()

The enter key is bound to a function that puts a newline character inside the directEntry, that way you can press enter to skip to a new line, this however works only slightly, the cursor in the entry appears to skip to the front of the original line, until you begin typing (run it, it’s really strange) Also it has no effect how big of a number I pass into setCursorPosition, it’s the same glitch either way.

And obviously, any way to impliment a “use arrow up/down” to navigate up rows/down rows?

If anyone knows any other tricks to build a nice “area” to input a large amount of text (typing a letter, etc) then PLEASE inform me, I would be grateful for any help at all.

Thank you,
~powerpup118