Help with Toolbox: Messages and Text windows

Help with Toolbox: Messages and Text windows

Post by M Y Ben Gersh » Sat, 23 Dec 1995 04:00:00



I would appreciate any help you could give on the following:

I am completely new to WIMP programming, and the Toolbox manual
does not help with these problems.

I need to receive a WIMP message from another application.  It
will only be sent to this ap (the other app has our task handle).

I then need to load a file whose filename is given in the message body,
and then display it in a window (it cannot be edited!).

How do I
a)      receive the message (there is no Wimp message class - am I
        missing something - should I be doing something else?

b)      How on earth do I control the display of text in the window?

Thanks,

Michael Ben-Gershon


 
 
 

Help with Toolbox: Messages and Text windows

Post by Cy Book » Sat, 23 Dec 1995 04:00:00



Quote:> I would appreciate any help you could give on the following:

> How do I
> a) receive the message (there is no Wimp message class - am I
>    missing something - should I be doing something else?

Assuming that you are using tboxlib (oh dear) then in your
initialising function call:

        event_register_message_handler()

with the parameter being the function that contains your code
to handle it.  Cast the WimpMessage.data to a const char *
and use that (taking care to handle a malformed message with
no terminating NUL).

As to the message number: you should apply to Pineapple for a
chunk of 64 message numbers.  Or meanwhile just make one up
somewhere in the user-SWI range.

Quote:> b) How on earth do I control the display of text in the window?

Basically, you do it yourself!  There are various ways one can
fake it though.  The easiest is to run-time generate a text icon
per line.  This is adequate for plain text display, but aint fast
to redraw, and does not scale well for large gobs of text.

Next easiest solution is to (probably) convert the text into a
Draw file (text area) object(s) and use the DrawFile module to
render it.

But if you want the user to be able to drag a selection, then
be prepared for a few long evenings programming lots of code that
should be in the wimp.

If you're feeling magnamanous you could then upload your rich-
text-file rendering code to a handy ftp site :-)

  Cy.

 
 
 

1. Text Windows in Toolbox

Am I being dumb or is there no way to add a large text window to a toolbox
program without going around the toolbox? I can see how to do single line
text icons but not anything which will display large ammounts of text with
scroll bars...

AlexMC

2. Lotus Millennium 1-2-3 R 9 Date question

3. Toolbox - Text Area gadget

4. 2.04 on my 1000 -- How?

5. Toolbox Error messages

6. I NEED YOUR HELP PLEASE ....

7. WIMP messages and the Toolbox

8. HP printer jams paper

9. Toolbox messages between tasks

10. Beginner - picking up Toolbox error messages.

11. Is there a text editor for Windows as good as Edit?

12. Basic Text windows

13. Updating window title bar indirected text