Poster | Thread |
redfox
| |
SOLVED ... How do I display a text file using RxMUI? Posted on 19-Apr-2019 3:46:08
| | [ #1 ] |
|
|
|
Elite Member |
Joined: 7-Mar-2003 Posts: 2064
From: Canada | | |
|
| Sorry, the program lines below do not show the spaces at the beginning of lines between do command and end command.
I am building a program using RxMUI. I want to display a text file in a window. The text file is external to the program, for example a readme file. So far, I have figured out how to open a window with a nice menu, but I can't figure out how to actually display the text in the window. The RxMUI examples I found do not cover this topic. Most of them use text that is internal to the example program. So I don't know if I can use the simple window I created or if I have to define a listview or something more complicated.
The following examples open the text file, read a line, display it in the window and repeat until the end of the file. The first example uses MicroRexx. The second example uses rexxbgui.library.
Using MicroRexx, for example, this is very easy... there is an NPRINT command that prints the text in the window.
call open(file,"ram:readme",READ) do until eof(file) text = readln(file) /* read a line of text */ 'NPRINT' w '"'text'"' /* add quotes and display in window */ end call close(file)
Using rexxbgui.library, for example, it is a little harder ... I added the text to a listview in the window.
call open(file,"ram:readme",READ) do until eof(file) text = readln(file) call bguilistvaddentry(obj.listv,,text) end call close(file)
Any help would be greatly appreciated.
--- redfox
Last edited by redfox on 19-Apr-2019 at 11:15 PM. Last edited by redfox on 19-Apr-2019 at 11:14 PM. Last edited by redfox on 19-Apr-2019 at 05:17 PM. Last edited by redfox on 19-Apr-2019 at 05:15 PM. Last edited by redfox on 19-Apr-2019 at 05:14 PM. Last edited by redfox on 19-Apr-2019 at 03:50 AM.
|
|
Status: Offline |
|
|
redfox
| |
Re: SOLVED ... How do I display a text file using RxMUI? Posted on 19-Apr-2019 23:19:38
| | [ #2 ] |
|
|
|
Elite Member |
Joined: 7-Mar-2003 Posts: 2064
From: Canada | | |
|
| SOLVED .... I found an example using NListview class and the program showed how to add lines of text to the listview.
Working fine, except that the font is a variable-width font, where the letters and spacings have different widths. I need a mono-spaced font, such as DejaVu Sans Mono/15.
--- redfox
Last edited by redfox on 19-Apr-2019 at 11:26 PM.
|
|
Status: Offline |
|
|
broadblues
| |
Re: SOLVED ... How do I display a text file using RxMUI? Posted on 20-Apr-2019 4:18:59
| | [ #3 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| |
Status: Offline |
|
|
redfox
| |
Re: SOLVED ... How do I display a text file using RxMUI? Posted on 21-Apr-2019 1:39:50
| | [ #4 ] |
|
|
|
Elite Member |
Joined: 7-Mar-2003 Posts: 2064
From: Canada | | |
|
| @broadblues
Thanks Andy. I'll try those suggestions.
--- redfox
|
|
Status: Offline |
|
|
redfox
| |
Re: SOLVED ... How do I display a text file using RxMUI? Posted on 23-Apr-2019 17:23:44
| | [ #5 ] |
|
|
|
Elite Member |
Joined: 7-Mar-2003 Posts: 2064
From: Canada | | |
|
| @broadblues
Thanks so much. Using the texteditor.mcc class in readonly mode with fixed width font.
--- redfox
|
|
Status: Offline |
|
|
redfox
| |
Re: SOLVED ... How do I display a text file using RxMUI? Posted on 24-Apr-2019 21:34:05
| | [ #6 ] |
|
|
|
Elite Member |
Joined: 7-Mar-2003 Posts: 2064
From: Canada | | |
|
| @broadblues
Thanks again Andy. Today I figured out how to set the Font attribute to fixed for NListview class.
Thanks, redfox
|
|
Status: Offline |
|
|