ed@gargoyle.UUCP (Ed Friedman) (03/08/86)
Has anyone successfully created a window with a CLI in it? According to the manuals, you are supposed to use execute with an empty string, a file handle referring to a new window, and 0 for the output. I tried the following: nullstring[0] = '\0'; execute(nullstring, &W, 0); where W is the pointer to the window I just opened. The results were that the screen went all black, and the program acted as if it were dead (or not having access to i/o). I then changed the execute command to be: execute(nullstring, W, 0); and this caused the machine to crash. My question is: just what is meant by a file handle to a new window? What am I doing wrong? Also, the reason I am doing all of this is to allow users of my program access to multitasking even though my program uses a customscreen. My solution is to create a dummy window with a NEWCLI in it. Is there some better solution to this problem? Thanks in advance, Ed Friedman
mykes@3comvax.UUCP (Mike Schwartz) (03/11/86)
In article <357@gargoyle.UUCP> ed@gargoyle.UUCP (Ed Friedman) writes: >Has anyone successfully created a window with a CLI in it? According to the >manuals, you are supposed to use execute with an empty string, a file handle >referring to a new window, and 0 for the output. > > I tried the following: > >nullstring[0] = '\0'; >execute(nullstring, &W, 0); > >where W is the pointer to the window I just opened. The results were that the >screen went all black, and the program acted as if it were dead (or not having >access to i/o). I then changed the execute command to be: > >execute(nullstring, W, 0); > >and this caused the machine to crash. > > My question is: just what is meant by a file handle to a new window? >What am I doing wrong? Also, the reason I am doing all of this is to allow >users of my program access to multitasking even though my program uses a >customscreen. My solution is to create a dummy window with a NEWCLI in it. >Is there some better solution to this problem? > > Thanks in advance, > Ed Friedman This is something that I too wish to do, and I am sure that Matt Dillon would to (for his shell program). What Ed is doing wrong is that he is passing the address of an intuition window structure to Execute() which is expecting a pointer to a FileHandle structure... I looked at the possibility of building my own FileHandle structure, but the AmigaDos documentation I have is thin in this area, and the folks at Commodore Amiga seem reluctant to open this messy can of worms to the public - I don't blame them. I discussed this problem with Neil Kadin (sorry if I misspelled it) at Amiga, and we talked about using sprintf() to create a special Open() string that would supplement the "raw:n/n/n/n/title" string. What he suggested was that Amiga might add the following capability: . sprintf(string, "win=%x", &My_Intuition_Window); . Open(string, MODE... I personally would rather see a custom BuildFileHandle() function of some sort. One other item of interest to this newsgroup is that they (Amiga) have considered adding a preference-like item to allow 640 x 400 workbench screens! I like the idea, because I think all those tiny little icons and huge CLI (would you believe 40+ lines of 78 chars?) windows would be fine looking. BTW, I am using a 640x400 terminal program that I am working on, and Unix looks real nice with 48 lines of text on the screen. I use black text on white background (looks like a mac, except higher resolution). I reduce the flicker to a quite tolerable (to my taste) level by turning down the bright and contrast on my Amiga monitor. My terminal program uses the console.device driver, so full 48 line ansi escape sequences work fine, and nroff or troff or whatever the unix manual program uses, uses underlining etc. real nicely.
lbg@gitpyr.UUCP (03/12/86)
In article <357@gargoyle.UUCP>, ed@gargoyle.UUCP (Ed Friedman) writes: > Has anyone successfully created a window with a CLI in it? That reminds me. Every time I open a CLI window, I immediately have to resize it to fill the screen. Surely there is a way to do something like a snapshot, so that from now on, when CLI opens, it will fill the screen. Am I going to have to hack the NEWCLI program to do this, or is there another way? It's not a big deal to move and resize the window, but it does get old to have to do it every single time. Lee
bruceb@amiga.UUCP (Bruce Barrett) (03/13/86)
In article <357@gargoyle.UUCP> ed@gargoyle.UUCP (Ed Friedman) writes:
[... "?" about using Execure() to open a newcli ...]
Try:
W = Open("CON:10/10/300/140/Test", MODE_NEWFILE);
Execute(nullstring, W, 0);
It may not do what you want or expect, but it will work.
tenney@well.UUCP (Glenn S. Tenney) (03/13/86)
In article <444@3comvax.UUCP> mykes@3comvax.UUCP (Mike Schwartz) writes: > ... What Ed is doing wrong is that he is passing the >address of an intuition window structure to Execute() which is expecting a >pointer to a FileHandle structure... I looked at the possibility of building >my own FileHandle structure, but the AmigaDos documentation I have is thin in >this area, and the folks at Commodore Amiga seem reluctant to open this messy >can of worms to the public - I don't blame them. A part of what you're asking seems to be "what is the window for the CON: or RAW: I opened?" We needed to do that too and found the published way to do just that, but it didn't work. If you look in the AmigaDOS developer manual (or reference manual) that discusses the DOS packets, you will find that a diskinfo request to your raw: will return the window pointer (I know, I never would have guessed it either!). We reported this bug months ago and were told to expect it to be fixed in 1.2. Of course, this doesn't take care of the case where you opened your own custom screen and then want a raw: in that screen. Hmmm, maybe it opens the window in the current active screen? There are many good uses for a raw: window mixed with graphics and faster text, sigh... -- Glenn Tenney UUCP: {hplabs,glacier,lll-crg,ihnp4!ptsfa}!well!tenney ARPA: well!tenney@LLL-CRG.ARPA Delphi and MCI Mail: TENNEY As Alphonso Bodoya would say... (tnx boulton) Disclaimers? DISCLAIMERS!? I don' gotta show you no stinking DISCLAIMERS!
bruceb@amiga.UUCP (Bruce Barrett) (03/14/86)
In article <1531@gitpyr.UUCP> lbg@gitpyr.UUCP (Lee) writes: > >That reminds me. Every time I open a CLI window, I immediately have to >resize it to fill the screen. [...] Don't know if this will help but you can type: newcli "con:0/0/640/200/My CLI Title" or put it in an execute file. . . | \___/ -- Bruce Barrett
page@ulowell.UUCP (Bob Page) (03/18/86)
In article <1531@gitpyr.UUCP> lbg@gitpyr.UUCP writes: >That reminds me. Every time I open a CLI window, I immediately have to >resize it to fill the screen. Surely there is a way to do something like >a snapshot, so that from now on, when CLI opens, it will fill the screen. >Am I going to have to hack the NEWCLI program to do this, or is there >another way? You're going to have to hack the NEWCLI program, but it's no big deal. See page 12 of this month's Amazing Computing for a little Basic program to do just that. ..Bob -- UUCP: wanginst!ulowell!page Bob Page ARPA: page@ulowell.CSNET U of Lowell CS Dept VOX: +1 617 452 5000 x2233 Lowell MA 01854 USA