[comp.sys.acorn] Creation of a Taskwindow

boerhout@convex.nl (Jan Boerhout) (04/29/91)

I want to be able to start a program in a task window from an obey file
without having to create a task window manually using !Edit and without
having to start my program manually in this window.

Has somebody figured out how to do this?

RMokady@acorn.co.uk (Ran Mokady) (05/06/91)

In article <1744@nlcvx.convex.nl> boerhout@convex.nl (Jan Boerhout) writes:

>I want to be able to start a program in a task window from an obey file
>without having to create a task window manually using !Edit and without
>having to start my program manually in this window.
>
>Has somebody figured out how to do this?

I don't think there is a way of doing it properly, but you could try the
following BASIC program:  

REM >Task
SYS "OS_GetEnv" TO command$
D%=INSTR(command$,"$")
IF D%=0 THEN ERROR EXT 0,"Missing TaskWindow command"
DIM block% 256, task% 5
$task%="TASK"
block%!0=36
block%!12=0
block%!16=&808c5
$(block%+20)="ShellCLI_Task"+CHR$0
SYS "Wimp_Initialise",200,!task%,"TaskWindow"
SYS "Wimp_SendMessage",17,block%,0
SYS "OS_Byte",138,0,13
FOR I%=D%+1 TO LEN(command$)
 SYS "OS_Byte",138,0,ASC(MID$(command$,I%,1))
NEXT I%
SYS "OS_Byte",138,0,13
REPEAT SYS "Wimp_Poll",0,block% TO R%:UNTIL R%=0
END
          
Save it as "Task" in your library directory, and then in your obey file put:

Task $<command>    

Where <command> is the command you want executed in the task window.

For this to work you have to have !Edit and the TaskWindow modules loaded.

  The BASIC program sends a message to !Edit telling it to open a
TaskWindow, it then inserts the anything following the $ on the command used
to start it into the keyboard buffer, so that it is picked up by !Edit as
input for the task. The first OS_Byte 138,0,13 is to reduce the risk of
something being typed in from the keyboard before it has a chance to insert
the codes into the buffer, but it is still not perfect if you happen to be
typing things in while it is running. The last line before the END is used
to enable you to have two *Task commands one after the other, if it is
missed out, two task windows will be opened, but both commands will be run
in the same window.

 If anyone knows of a better way to do this, please let me know !

                                 Ran.


-----
"We're children, Needing other children
 And yet letting our grown up pride
 Hide all the need inside
 Acting more like children than children" 

Julian.Wright@comp.vuw.ac.nz (Julian Wright) (05/07/91)

I have superficially examined the TaskWindow module. It appears that,
unlike other *commands, the ShellCli_Task command this module provides
IS case sensative, and requires the syntax:

*ShellCLI_Task tttttttt wwwwwwww *command

where tttttttt is the task handle and wwwwwwww is the window handle of
the window to send output to and receive input from. The data is
transferred between the shellcli task and the window task via messages,
the format of which I have yet to decipher. The two handles are
specified in hex, with leading zeros to make them exactly 8 characters
in length each.

Could anyone at Acorn reading this (or anyone else for that matter)
please shed some light on the format of the messages? It would be very
nice to hit F12 and have a taskwindow pop up rather than have commands
scroll the desktop off the top of the screen... It might also be possible
to implement a 'virtual screen' via redirection to a sprite - and have
for example, the Basic Editor running in a window in the desktop...

    Cheers, Julian.
-- 
;`````````````````````````````````````````````````````````````````````````````;
; I would if I could but I can't so I won't but I might if I find I can later ;
;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;
jwright@comp.vuw.ac.nz                                julian@sideways.gen.ac.nz

fl@tools.uucp (Frank Lancaster) (05/08/91)

> scroll the desktop off the top of the screen... It might also be possible
> to implement a 'virtual screen' via redirection to a sprite - and have
> for example, the Basic Editor running in a window in the desktop...

Hmm. I've written a programme called !TaskTool which does exactly this.
You can run any programme which uses VDU sequences for graphic output
in it. Alas, this programme is not public domain, but I've seen illegal
copies of it popping up in many places.

Frank

Julian.Wright@comp.vuw.ac.nz (John Julian Wright) (05/09/91)

In article <FL.91May8102356@fidel.tools.uucp>, fl@tools.uucp (Frank
Lancaster) writes:

|> Hmm. I've written a programme called !TaskTool which does exactly this.
|> You can run any programme which uses VDU sequences for graphic output

Sounds wonderful! How big is it itself? Do you need multiple copies of it to
run multiple VDU tasks?

|> in it. Alas, this programme is not public domain, but I've seen illegal
|> copies of it popping up in many places.

Is it shareware or commercial then? If commercial, who markets it and for
how much? I haven't seen it advertised anywhere (although I might have
missed it).

    Cheers, Julian.
-- 
;`````````````````````````````````````````````````````````````````````````````;
; I would if I could but I can't so I won't but I might if I find I can later ;
;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;
jwright@comp.vuw.ac.nz                                julian@sideways.gen.ac.nz