Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 23 |
Nodes: | 6 (0 / 6) |
Uptime: | 54:45:03 |
Calls: | 583 |
Files: | 1,139 |
D/L today: |
179 files (27,921K bytes) |
Messages: | 111,801 |
I wish to send dozen lines of text to a wimp window without icons in
a programme I'm writing. How do I do it?
For literally decades I have avoided trying to place text in a window
and have managed with icons. The reason is simple, in over 40 years I
cannot find anywhere a simple explanation of how to do it.
Yes, I know a bit about some thing, works_area and visible_area,
redraw boxes etc. I'm not yet "stuck" on those things.
But how the blazes you write the letter A to a wimp window I've never understood. I would love a clue to this.
How do you select the window?
What cursor is it graphics VDU5 or text and why?.
How do you move it (I'm NOT coding in BASIC)?
Can you then use OS_WriteC etc. ?
In a redraw loop it is using the graphics cursor, so you can move
using OS_Plot 4 and write the text with OS_WriteC. But that will
give you horrible old system font which doesn't look good compared
to everything else the Wimp font.
In a redraw loop it is using the graphics cursor, so you can move using OS_Plot 4 and write the text with OS_WriteC. But that will give you
horrible old system font which doesn't look good compared to everything
else the Wimp font.
Another option is to have an icon which is a sprite and occupies
all of your window. Then, using VDU commands, redirect your
OS_Plot, Font_Paint, etc drawing to the sprite instead of the
screen.
In article <Lyl*BM2jA@news.chiark.greenend.org.uk>,
Theo <theom+news@chiark.greenend.org.uk> wrote:
Another option is to have an icon which is a sprite and occupies all of
your window. Then, using VDU commands, redirect your OS_Plot,
Font_Paint, etc drawing to the sprite instead of the screen.
Another option is to have an icon which is a sprite and occupies all of your window. Then, using VDU commands, redirect your OS_Plot, Font_Paint, etc drawing to the sprite instead of the screen.
REPEAT
SYS "Wimp_Poll",bitmask%,b% TO pollevent%,b%
CASE pollevent% OF
WHEN 0 : PROCtextplot
ENDCASE
UNTIL finished%
END
I wish to send dozen lines of text to a wimp window without icons
in a programme I'm writing. How do I do it?
For literally decades I have avoided trying to place text in a
window and have managed with icons. The reason is simple, in over
40 years I cannot find anywhere a simple explanation of how to do
it.
Yes, I know a bit about some thing, works_area and visible_area,
redraw boxes etc. I'm not yet "stuck" on those things.
But how the blazes you write the letter A to a wimp window I've
never understood. I would love a clue to this.
How do you select the window? What cursor is it graphics VDU5 or
text and why?. How do you move it (I'm NOT coding in BASIC)?
Pity as I was going to suggest The Application Tutorial and Listings
Book by Chris Dewhurst of Drag 'n Drop fame. There is an example of
getting text into a window but as Druck says by means of an icon(s).
The book is written for BASIC users which I don't think is what you
want.
I have been looking at the possibility of using icons. The big
disappointment with them to me is that I don't think you can change the pointer to text buffer *after* the icon has been created. So no fast and
easy way to make an icon based window scroll even just a few lines.
On 15 Aug, Bob Latham wrote in message
<5c4cd689e8bob@sick-of-spam.invalid>:
I have been looking at the possibility of using icons. The big disappointment with them to me is that I don't think you can
change the pointer to text buffer *after* the icon has been
created. So no fast and easy way to make an icon based window
scroll even just a few lines.
Use self-redraw and Wimp_PlotIcon, plus a single icon template that
you change the details in before each call. That way, you can also
set the window extent and use normal Wimp scrolling.
For an example in C, see (sorry, this is probably Iris or a
non-RISC OS browser).
https://github.com/steve-fryatt/printpdf/blob/eede3c2050353f55c0151776e187dd9bb0181696/src/convert.c#L1571
(there's similar code in CashBook, Locate, PS2Paper, Puzzles and
probably other places too, but I think this is the smallest and
simplest example that I've got).
In article <5c4c6c50b0basura@invalid.addr.uk>,I use a text-area (tool box), while waiting for reunification ...
Richard Ashbery <basura@invalid.addr.uk> wrote:
Pity as I was going to suggest The Application Tutorial and Listings
Book by Chris Dewhurst of Drag 'n Drop fame. There is an example of
getting text into a window but as Druck says by means of an icon(s).
The book is written for BASIC users which I don't think is what you
want.
I have been looking at the possibility of using icons. The big
disappointment with them to me is that I don't think you can change
the pointer to text buffer *after* the icon has been created. So no
fast and easy way to make an icon based window scroll even just a few
lines.
Thanks for the suggestion.
Bob.
These icons are just temporary and in effect they place a line of
text on the window and then the icon no longer exists, just leaving
the text on the screen.
That means you can create them as you need without any count?
Is this on the right lines..
Plot an icon for line 1 near top of screen.
Next text line comes along...
Plot an icon for line 2 under line 1.
Continue until screen is filled then....
Next line comes in.
Plot a new bottom icon which covers the previous one.
Plot an icon 1 line higher with the text for what was the bottom line
last time. etc.
As for the redraw loop..
Can I cheat to start with? ie. rely on the clip window and redraw
the entire window each time? Have that as a sort of base camp for
this mountain climb.
Not sure I'm clever enough to work all this out but I'm going to try.
On 2025-08-16, Bob Latham <bob@sick-of-spam.invalid> wrote:
You'll need to have a list of all of the lines of text, which you
can add to (or shift up if you're discarding the oldest line each
time).
You then invalidate the redraw state of the lines that you
want to replace using Wimp_ForceRedraw
and let your redraw routine handle the plotting.
What language are you working in?
I could probably put a quick example together in BASIC later this
week, if that would help?
On 2025-08-16, Bob Latham <bob@sick-of-spam.invalid> wrote:
As for the redraw loop..
Can I cheat to start with? ie. rely on the clip window and redraw
the entire window each time? Have that as a sort of base camp for
this mountain climb.
Yes, that's completely fine. Modern hardware won't really notice
unless you have a lot of lines, and you can come in to optimise
things later.
In article <slrn10a61bo.372r.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:
On 2025-08-16, Bob Latham <bob@sick-of-spam.invalid> wrote:
As for the redraw loop..
Can I cheat to start with? ie. rely on the clip window and redraw the
entire window each time? Have that as a sort of base camp for this
mountain climb.
Yes, that's completely fine. Modern hardware won't really notice unless
you have a lot of lines, and you can come in to optimise things later.
To my huge surprise, I now have text scrolling in a window in an
application I've put together. Yes, it's a bit of a hack in that I don't
draw the individual rectangles but it's probably all I need. It did
flicker slightly when my phantom icons had different colour backgrounds
to the window they're sat on but it was much reduced when I set the same colour.
Thanks to everyone who offered their help.
I still can't quite believe I got it working..
Thanks to everyone who offered their help.
I still can't quite believe I got it working..