Page 1 of 1

Text dump in window

Posted: Sat Jul 16, 2005 12:34 am
by Thomas
On a console you can use the print command to quickly dump out huge amounts of text. When using the debugger you can use the debug command. But in a compiled program I always missed a command to easily write text into a window for streaming output. You can use gadgets for that but a simple command just for some quick text output would be neat.

Posted: Sat Jul 16, 2005 8:22 am
by fweil
Does not a simple MessageRequester() answer ?

Or maybe you have a better way you would describe for suggestion ...

Rgrds

Posted: Sat Jul 16, 2005 10:12 am
by Thomas
The window size should be variable and there should be a text output box (a bit like the editor gadget) with a scroll bar so you could scroll back. It should be possible to add text each time you issue the print command.

Example:

Code: Select all

OpenTextWindow(0, 100, 100, 200, 200)
WPrintN("Hello World!")
CloseTextWindow(0)

Posted: Sat Jul 16, 2005 1:03 pm
by PB
Here's a way you could emulate it for the time being:

Code: Select all

Procedure WPrintN(text$)
  Static y : StartDrawing(WindowOutput()) : DrawingMode(1)
  Locate(0,y) : DrawText(text$) : y+16 : StopDrawing()
EndProcedure

If OpenWindow(0,200,200,400,300,#PB_Window_SystemMenu,"test")
  For r=1 To 10 : WPrintN(Str(r)) : Next
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
> The window size should be variable and there should be a text output box
> (a bit like the editor gadget) with a scroll bar so you could scroll back

Sounds like you just described a ListViewGadget. ;)

Posted: Sat Jul 16, 2005 3:12 pm
by Thomas
PB wrote:Sounds like you just described a ListViewGadget. ;)
In a ListViewGadget you can click on the lines that is not good for a plain text output window. Want to get rid off all this gadget handling for just printing out some text.