forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Closing the generic "Output Window"

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sat Oct 18, 2014 10:14 pm    Post subject: Closing the generic "Output Window" Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2816
Location: South Pole, Antarctica

PostPosted: Sun Oct 19, 2014 4:47 am    Post subject: Reply with quote

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


and when you will need to close %cw just do
Code:
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 Smile
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sun Oct 19, 2014 5:24 am    Post subject: Reply with quote

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]
Code:
[img][/img][url][/url]
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Sun Oct 19, 2014 9:44 am    Post subject: Reply with quote

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

Code:
WINAPP
program main
include <windows.ins>
logical L
print*, "Hello World"
i = FindWindow("SalfordClass","Output")
pause "Hello again"
L = DestroyWindow(i)
end
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sun Oct 19, 2014 2:50 pm    Post subject: Reply with quote

Paul, many thanks for the code fragment.

Works perfectly, and it is now a permanent part of the code modifications in the closing routine.
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2816
Location: South Pole, Antarctica

PostPosted: Sun Oct 19, 2014 3:52 pm    Post subject: Reply with quote

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.

Last edited by DanRRight on Sun Oct 19, 2014 5:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sun Oct 19, 2014 4:30 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2816
Location: South Pole, Antarctica

PostPosted: Sun Oct 19, 2014 6:01 pm    Post subject: Reply with quote

Most of what we know and suggest to others we got directly or indirectly from Paul Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group