Text dump in window

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Text dump in window

Post 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.
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Does not a simple MessageRequester() answer ?

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

Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post 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)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post 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.
Post Reply