Silverfrost Forums

Welcome to our forums

Closing the generic \"Output Window\"

18 Oct 2014 9:14 #14884

I'd like to be able to close the output window when the program is done, but I cannot find a way that works. I've tried closing the logical unit (=1), but this does nothing. I tried creating a window (%cw) and 'attaching' it to a logical unit, but no joy.

I may be doing something wrong, or missing something in the manual.

Anyone have a handy way to close the Output window?

Thanks, Bill

19 Oct 2014 3:47 #14887

Add %lw to %cw

i = winio@('%120.40cw[hscroll,vscroll]%lw[owned]&', IOunit, ilwCW)

and when you will need to close %cw just do

ilwCW=0
call window_update@(ilwCW) 

/* i think that was one of the first questions i asked almost 20 years ago and got this answer from Paul 😃

19 Oct 2014 4:24 #14888

Thanks for the reply, but this is not the problem (although I will keep it in mind). I tried this, and while a window was created, and your code forced it to close at the end, that window is not the one I'm trying to close.

When I start the program, and write to the standard output device (IOUNIT=1) a window is created that contains all the output (and the name 'Output' is the title of the window), and it is used as the echo of manual inputs. This is the window I'm trying to close automatically. I tried to attach logical unit 1 to the window, per your example, but it was not successful in re-directing the output.

I have tried using some other functions, but since I don't have control of the window creation at the beginning, I can't seem to close it.

I admit; I'm new to this environment. That said, there has to be some way to close this window. I've tried closing the logical unit, tried to create a control into the window that I could, via call back, force it to close, and a couple of other things.[img][/img][img][/img] [img][/img]

19 Oct 2014 8:44 #14890

I am guessing at what you want to do. If I am right then one way is to use FindWindow then DestroyWindow under program control. This illustrates the principle...

WINAPP
program main
include <windows.ins>
logical L
print*, 'Hello World'
i = FindWindow('SalfordClass','Output')
pause 'Hello again'
L = DestroyWindow(i)
end
19 Oct 2014 1:50 #14894

Paul, many thanks for the code fragment.

Works perfectly, and it is now a permanent part of the code modifications in the closing routine.

19 Oct 2014 2:52 (Edited: 19 Oct 2014 4:49) #14895

I'd suggest get rid and don't use this archaic way of output at all, use %cw. If you create %cw with IOunit=0 then your standard output print* will go to it instead of automatically created huge ugly uncontrollable out of style output window you will need to destroy. If you created several %cw one for example with IOunit say 155 and another with 156 then when you write(155,) the output will go to one window and write(156,) to another window - great style and convenience because you can chose window size, place and color of background and inside of it the text size, font and color.

19 Oct 2014 3:30 #14896

Thanks, Dan. I'll give this consideration.

As in any conversion effort, I'll get it all working in this new compilation environment, then add the features. The CheckMate option has been enlightening, as it has pointed out a few bugs that have existed (benignly) for many years (nay, decades!)

You bring up a good point about the output windows. I have need (for the user's usage) to have a window that they can look at and review, or send it directly to a file for eventual output.

Right now, the Output window is used mostly for my debugging efforts. I may decide use a 'Status' window for messages that are informative only about how the processes are progressing. The Message dialog is for (near) fatal errors that the user needs to address before proceeding.

This conversion is the biggest I've done since the mid-90's when I produced a Windows (C++) version of the basic data entry section that was ANSI.SYS/DOS-Window oriented. Now I have the opportunity to get the entire suite converted and breath new life into it!

Having lots of fun, and appreciating the help I'm getting from you and others, especially Paul.

19 Oct 2014 5:01 #14897

Most of what we know and suggest to others we got directly or indirectly from Paul 😃

Please login to reply.