replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Printing text in window
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 

Printing text in window

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
jcherw



Joined: 27 Sep 2018
Posts: 57
Location: Australia

PostPosted: Wed Apr 10, 2019 12:43 pm    Post subject: Printing text in window Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 10, 2019 2:15 pm    Post subject: Reply with quote

You can use %cw.
Back to top
View user's profile Send private message AIM Address
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: D�sseldorf, Germany

PostPosted: Wed Apr 10, 2019 3:26 pm    Post subject: Reply with quote

... 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
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 57
Location: Australia

PostPosted: Fri Apr 12, 2019 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: D�sseldorf, Germany

PostPosted: Fri Apr 12, 2019 12:17 pm    Post subject: Reply with quote

There are two types of windows: �ClearWin� windows and �Format� windows. For more details about the first ones see here: https://www.silverfrost.com/ftn95-help/clearwinp/clearwin/introduction.aspx

I use ClearWin windows only for simple textual output. There are some functions available, see here: https://www.silverfrost.com/ftn95-help/clearwinp/overview/clearwinwindowfunctions.aspx

The huge amount of possibilities with winio@ can only be used with format windows, as far as I know.
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: D�sseldorf, Germany

PostPosted: Fri Apr 12, 2019 12:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 57
Location: Australia

PostPosted: Sat Apr 13, 2019 3:35 am    Post subject: Reply with quote

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
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 57
Location: Australia

PostPosted: Tue Apr 16, 2019 6:23 am    Post subject: Reply with quote

Thanks John. Very clear example.

I noticed indeed the minimized icon issue. Just made MDI window fixed size for now.
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 -> ClearWin+ 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