View previous topic :: View next topic |
Author |
Message |
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Wed Apr 10, 2019 12:43 pm Post subject: Printing text in window |
|
|
I am writing a program which generates quite some logging info which I like to write into a dedicated window using a unit pointing to that window via
call OPEN_TO_WINDOW@(7,5)
The main program window is opened as a frame
iAns=winio@('%pv%fr&',1400L,800L)
And I have managed to open graphics windows and route graphics output into those windows, using the following code
! Open window for logging text
iHndLog = 5
iAns=winio@('%ca[Log output]%bg[grey]&')
ians=winio@('%pv%aw&',iCtrl)
ians=winio@('%`gr[white]', 800, 600, iHndLog)
Could someone please enlighten me how to open a text window which than can be written into via unit 7 using the above call OPEN_TO_WINDOW@(7,5)
Cheers, |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Apr 10, 2019 2:15 pm Post subject: |
|
|
You can use %cw. |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Wed Apr 10, 2019 3:26 pm Post subject: |
|
|
... or:
Code: | integer*4 textwin
textwin = create_window@('Info',100,100,700,500)
call open_to_window@(7,textwin)
write(7,'(A)')' for example this message '
...
...
call destroy_window@(textwin) |
|
|
Back to top |
|
 |
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Apr 12, 2019 10:22 am Post subject: |
|
|
Thanks for these replies.
I tried %cw and got that to work.
I am relatively new to clearwin and sofar i have been using winio@ and the format codes following examples from the manual.
The function "create_window@" seems quite convenient. Can I use that function in conjunction with some winio@ calls to add further attributes to the created window? |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Fri Apr 12, 2019 12:42 pm Post subject: |
|
|
For output of text you may also use winio@ together with functions and options for editing.
If you like, you can download a complete text editor using ClearWin from here: https://drive.google.com/file/d/1zP1B6Cyfz6ee4TexNNeTuxrbzU0jqhYG/view?usp=sharing
(Source code in FTN77 style, together with standard icons. Use the make.bat file for compiling and linking). |
|
Back to top |
|
 |
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Sat Apr 13, 2019 3:35 am Post subject: |
|
|
Thanks for alla dvise.
I am opening window now with following statement:
iLarWin =
1 create_window@
1 ('PostProc - Timestep and saved arrays',120,120,700,500)
call open_to_window@(20,iLarWin)
and made the write and read statements all to/from unit 20
for the write statements all works fine, but for the read the program still opens a generic 'output' window
what am I missing?
Also, is there any way to make a clearwin window created with create_window@ a child window of another window? |
|
Back to top |
|
 |
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Tue Apr 16, 2019 6:23 am Post subject: |
|
|
Thanks John. Very clear example.
I noticed indeed the minimized icon issue. Just made MDI window fixed size for now. |
|
Back to top |
|
 |
|