Scrolled chat window in dgui

Saw in a previous post that there was overflow added to dgentry. I tried to create a scrolled text window from the manual and as soon as the nodes reach the bottom edge of the virtual frame, that’s all she wrote.

Do I need to programatically add/delete/modify text nodes in the virtual frame for this to work or is there some API that is undocumented?

Not really sure what you’re describing. Can you provide a simple code example?

David

Looking for something similar to wxPython’s style choice to make a text widget vertical scrolling.

What I have right now is a scrolled frame and then a virtual frame behind it.

Scrolled Window:

      self.myframe = DirectScrolledFrame(frameColor=(0, 0, 0, 1), 
      canvasSize = (-2,2,-2,2), 
      frameSize = (-1.31667, -0.35, -0.9, 0), 
      autoHideScrollBars = True, 
      scrollBarWidth = 0.04)
      self.myframe.setPos(0, -1, 0)

Virtual Frame with text node parented to:

      self.text = TextNode('node name')
      self.text.setText('')
      self.textNodePath = aspect2d.attachNewNode(self.text)
      self.textNodePath.reparentTo(self.myframe.getCanvas())
      self.textNodePath.setPos(-2, 0, 1.9)
      self.textNodePath.setScale(0.05)

Was hoping there was something along the lines of canvas.setStyle.VScroll(True).

Any pointing in the right direction would be great. Just trying to clean up some GUI parts before posting a code snippet for project beginners along the same lines as mine.

Ah, yes. There is no automatic vertical scrolling of DirectEntries supported, though it is possible to manage this yourself with some effort.

I think a one-line DirectEntry may perform horizontal scrolling, though. You have to enable “overflow mode” for this to work, and I haven’t tried it myself, but it might be something like this:

entry.guiItem.setOverflowMode(1)

David