View previous topic :: View next topic |
Author |
Message |
weaverwb
Joined: 04 Aug 2005 Posts: 37 Location: Monterey
|
Posted: Sun Apr 09, 2006 4:13 pm Post subject: clearwin window |
|
|
Hi,
How can I tell if a user has manually closed a ClearWin window attached to a Fortran Unit? If s/he has, I'd like, in the best of worlds, to reopen it at the size and position at which they left it. Update doesn't reopen it and inquire doesn't mind that it was manually (but not Fortran) closed.
Thanks,
Bruce Weaver _________________ Bruce+Weaver |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Mon Apr 10, 2006 12:51 am Post subject: clearwin window |
|
|
[Readers: please ignore this reply and follow the thread below. There is a better way and some of my comments below turn out to be inaccurate or just plain wrong. PL]
Bruce
1. If you have not already done so, embed your ClearWin window in a "format" window using %cw.
2. Use %lw or %ch to create a control variable. Its current value will indicate if a user has closed the window.
3. Use %sz for the size. The associated variables will be updated with the current size.
4. Use %gp from time to time to keep the latest window position.
4. When necessary reopen the window using the saved size (%sz) and position (%sp).
Note that you can use standard Fortran output without explicitly creating a ClearWin window and the reopening will happen automatically with the next WRITE statement. However, the size and position will not be the same.
There is a lot more that could be written but this may be enough to get you started. |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Mon Apr 10, 2006 1:43 am Post subject: clearwin window |
|
|
Bruce
Why not just remove the user option of being able to close the window, by using:-
i=winio@('%ww[no_sysmenu]&')
_________________ John Horspool
Roshaz Software Ltd.
Gloucestershire |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Apr 10, 2006 2:06 am Post subject: clearwin window |
|
|
Or you could use %cc to control the closure! |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Mon Apr 10, 2006 5:55 am Post subject: clearwin window |
|
|
Paul
In the help manuals the example for %gp shows it to be attached to a button. Is there a method to get a window position other than requiring the user to click on a button? And, how can multiple windows be handled, i.e. when the program creates a text output window and a graphics output window ?
Thanks
John _________________ John Horspool
Roshaz Software Ltd.
Gloucestershire |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Tue Apr 11, 2006 1:25 am Post subject: clearwin window |
|
|
John
It is not clear to me what you are looking for.
%gp gives the position of the next control and allows you to use %sp to set the position of other controls or windows.
%sz can be used to get the size of a window.
GET_WINDOW_LOCATION@ can be used to get its position.
|
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Tue Apr 11, 2006 4:28 pm Post subject: clearwin window |
|
|
Paul
Thanks, the get_window_location call was exactly what I needed.
John _________________ John Horspool
Roshaz Software Ltd.
Gloucestershire |
|
Back to top |
|
|
weaverwb
Joined: 04 Aug 2005 Posts: 37 Location: Monterey
|
Posted: Wed Apr 12, 2006 1:28 am Post subject: clearwin window |
|
|
Thanks Paul.
I was not embedding it but letting it float like other windows I had opened...now I'll go back and embed them all to keep the screen under control to maximize the amount of info the user can display.
Bruce Weaver _________________ Bruce+Weaver |
|
Back to top |
|
|
|